[PATCH 0/9] argument parsing fixes and improvements

Daniel Kahn Gillmor dkg at fifthhorseman.net
Tue Sep 19 14:43:18 PDT 2017


On Tue 2017-09-19 23:39:20 +0300, Jani Nikula wrote:
> I had some other things in mind, but ended up with this prep series
> instead... The main thing is patch 6 adding --no-argument style negating
> arguments for boolean and keyword flag args. The rest is mostly just
> refactoring and tests to make that happen.

this series looks like it does what it says on the label to me, though i
haven't tested it.

I'm not sure that the ux improvement is particularly significant,
though.  Is there a concrete advantage of offering --no-foo on in
addition to an already-present --foo=false ?  do we *want* there to be
many ways to achieve the same result in the cli?

I'm a little concerned that "notmuch search --exclude" is a corner case
that doesn't make a lot of sense here.

It's documented as:

          --exclude=(true|false|all|flag)
                 A message is called "excluded" if it matches at least one tag
                 in  search.tag_exclude that does not appear explicitly in the
                 search terms. This option specifies whether to omit  excluded
                 messages in the search process.

                 The  default  value,  true,  prevents  excluded messages from
                 matching the search terms.

                 all additionally prevents excluded messages from appearing in
                 displayed  results, in effect behaving as though the excluded
                 messages do not exist.

                 false allows excluded messages  to  match  search  terms  and
                 appear  in  displayed  results.  Excluded  messages are still
                 marked in the relevant outputs.

                 flag only has an effect when --output=summary. The output  is
                 almost  identical to false, but the "match count" is the num‐
                 ber of matching non-excluded messages in the  thread,  rather
                 than the number of matching messages.


It's "not quite" a boolean.  --exclude is mentioned in patch 6, but
isn't included here.

It's a NOTMUCH_OPT_KEYWORD, but it's not a flag, so the idea of a
bitwise boolean doesn't make sense for it.  i guess you just can't
"notmuch search --no-exclude=" then?


Also, this series should update the bash bindings so that the --no-
arguments are available.  And i think the documentation for the cli
should also be updated to mention --no-foo, right?

Regards,

        --dkg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20170919/3c153550/attachment.sig>


More information about the notmuch mailing list