summaryrefslogtreecommitdiffstats
path: root/notmuch-search.c
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2017-06-04 09:32:32 -0300
committerDavid Bremner <david@tethera.net>2017-08-01 21:17:47 -0400
commited4a9082c02d0a73f5f7d07f90a7daf65bde0aaa (patch)
treeb4c5b09aedc4c24ae168066681ac3b8a3602e016 /notmuch-search.c
parent50340bcb78586dc63b5e0914563665b30e8f88d0 (diff)
cli/search: print total number of files matched in summary output.
The structured output formats already have all of the filenames. This is an easy bit of UI change to make the multiple files visible.
Diffstat (limited to 'notmuch-search.c')
-rw-r--r--notmuch-search.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/notmuch-search.c b/notmuch-search.c
index 019e14ee..380e9d8f 100644
--- a/notmuch-search.c
+++ b/notmuch-search.c
@@ -160,6 +160,7 @@ do_search_threads (search_context_t *ctx)
const char *subject = notmuch_thread_get_subject (thread);
const char *thread_id = notmuch_thread_get_thread_id (thread);
int matched = notmuch_thread_get_matched_messages (thread);
+ int files = notmuch_thread_get_total_files (thread);
int total = notmuch_thread_get_total_messages (thread);
const char *relative_date = NULL;
notmuch_bool_t first_tag = TRUE;
@@ -175,13 +176,23 @@ do_search_threads (search_context_t *ctx)
if (format->is_text_printer) {
/* Special case for the text formatter */
- printf ("thread:%s %12s [%d/%d] %s; %s (",
+ printf ("thread:%s %12s ",
thread_id,
- relative_date,
+ relative_date);
+ if (total == files)
+ printf ("[%d/%d] %s; %s (",
matched,
total,
sanitize_string (ctx_quote, authors),
sanitize_string (ctx_quote, subject));
+ else
+ printf ("[%d/%d(%d)] %s; %s (",
+ matched,
+ total,
+ files,
+ sanitize_string (ctx_quote, authors),
+ sanitize_string (ctx_quote, subject));
+
} else { /* Structured Output */
format->map_key (format, "thread");
format->string (format, thread_id);