[PATCH 1/3] cli: add support for --no- prefixed boolean and keyword flag arguments

Jani Nikula jani at nikula.org
Sat Oct 14 13:21:47 PDT 2017


On Sat, 14 Oct 2017, William Casarin <jb55 at jb55.com> wrote:
> Hey Jani,
>
> Patches look good so far, concept ack for sure.
>
>
> Jani Nikula <jani at nikula.org> writes:
>
>> For example, you can use --no-exclude instead of --exclude=false in
>> notmuch show. If we had keyword flag arguments with some flags
>> defaulting to on, say --include=tags in notmuch dump/restore, this
>> would allow --no-include=tags to switch that off while not affecting
>> other flags.
>
> I've been testing it a bit, I can't seem to make this work in this example:
>
>     ./notmuch count --no-exclude
>
> After some brief investigation it might be because count is using
> EXCLUDE_true(1) and EXCLUDE_false(0) which are not equal to
> NOTMUCH_EXCLUDE_TRUE(1) and NOTMUCH_EXCLUDE_FALSE(2), but I'm not sure.

*blush* I screwed those enums up. Here's a patch that takes care of both
issues id:20171014201836.4486-1-jani at nikula.org. It's independent of
this series.

BR,
Jani.




More information about the notmuch mailing list