[RFC PATCH v2 1/3] cli: notmuch-show changes to support pick
Daniel Schoepe
daniel at schoepe.org
Sun Feb 12 13:08:23 PST 2012
On Sun, 12 Feb 2012 18:49:37 +0000, Mark Walters <markwalters1009 at gmail.com> wrote:
> + int opt_index, ret, entire_thread;
> + notmuch_sort_t sort = NOTMUCH_SORT_NEWEST_FIRST;
> const notmuch_show_format_t *format = &format_text;
> notmuch_show_params_t params = { .part = -1 };
> int format_sel = NOTMUCH_FORMAT_NOT_SPECIFIED;
> notmuch_bool_t verify = FALSE;
> + notmuch_bool_t headers_only = FALSE;
>
> notmuch_opt_desc_t options[] = {
> { NOTMUCH_OPT_KEYWORD, &format_sel, "format", 'f',
> @@ -1042,10 +1093,19 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
> { "mbox", NOTMUCH_FORMAT_MBOX },
> { "raw", NOTMUCH_FORMAT_RAW },
> { 0, 0 } } },
> + { NOTMUCH_OPT_KEYWORD, &sort, "sort", 's',
> + (notmuch_keyword_t []){ { "oldest-first", NOTMUCH_SORT_OLDEST_FIRST },
> + { "newest-first", NOTMUCH_SORT_NEWEST_FIRST },
> + { 0, 0 } } },
> { NOTMUCH_OPT_INT, ¶ms.part, "part", 'p', 0 },
> - { NOTMUCH_OPT_BOOLEAN, ¶ms.entire_thread, "entire-thread", 't', 0 },
> + { NOTMUCH_OPT_KEYWORD, &entire_thread, "thread", 't',
> + (notmuch_keyword_t []){ { "match", NOTMUCH_SHOW_THREAD_MATCH, },
> + { "entire", NOTMUCH_SHOW_THREAD_ENTIRE },
> + { "none", NOTMUCH_SHOW_THREAD_NONE },
> + { 0, 0 } } },
> { NOTMUCH_OPT_BOOLEAN, ¶ms.decrypt, "decrypt", 'd', 0 },
> { NOTMUCH_OPT_BOOLEAN, &verify, "verify", 'v', 0 },
> + { NOTMUCH_OPT_BOOLEAN, &headers_only, "headers-only", 'h', 0 },
> { 0, 0, 0, 0, 0 }
> };
>
> @@ -1055,6 +1115,9 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
> return 1;
> }
>
> + params.entire_thread = entire_thread;
entire_thread is not initialized here, if there is no --thread
argument. The rest of the code makes this result in the same behavior as
--thread=entire, but it should be initialized to
NOTMUCH_SHOW_THREAD_MATCH.
Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20120212/8a08ba53/attachment.pgp>
More information about the notmuch
mailing list