diff options
author | Carl Worth <cworth@cworth.org> | 2009-10-26 14:46:14 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2009-10-26 14:46:14 -0700 |
commit | 94f01d9de914b609e1f02385092b82fd61ca73b5 (patch) | |
tree | fcc611cb8fddbb520504a32ee0dd103a1ef0c075 /notmuch.c | |
parent | ef3ab5781a3730e019f92517366029540a960cd0 (diff) |
Add notmuch_thread_get_tags
And augment "notmuch search" to print tag values as well as thread ID
values. This tool is almost usable now.
Diffstat (limited to 'notmuch.c')
-rw-r--r-- | notmuch.c | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -610,6 +610,7 @@ search_command (int argc, char *argv[]) notmuch_query_t *query; notmuch_thread_results_t *results; notmuch_thread_t *thread; + notmuch_tags_t *tags; char *query_str; int i; notmuch_status_t ret = NOTMUCH_STATUS_SUCCESS; @@ -641,9 +642,23 @@ search_command (int argc, char *argv[]) notmuch_thread_results_has_more (results); notmuch_thread_results_advance (results)) { + int first = 1; + thread = notmuch_thread_results_get (results); - printf ("%s\n", notmuch_thread_get_thread_id (thread)); + printf ("%s (", notmuch_thread_get_thread_id (thread)); + + for (tags = notmuch_thread_get_tags (thread); + notmuch_tags_has_more (tags); + notmuch_tags_advance (tags)) + { + if (! first) + printf (" "); + printf ("%s", notmuch_tags_get (tags)); + first = 0; + } + + printf (")\n"); notmuch_thread_destroy (thread); } |