<feed xmlns='http://www.w3.org/2005/Atom'>
<title>notmuch/command-line-arguments.c, branch 0.28.1</title>
<subtitle>thread-based email index, search, and tagging</subtitle>
<id>https://git.notmuchmail.org/git/notmuch/atom?h=0.28.1</id>
<link rel='self' href='https://git.notmuchmail.org/git/notmuch/atom?h=0.28.1'/>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/'/>
<updated>2017-12-29T20:45:35Z</updated>
<entry>
<title>cli: some keyword options can be supplied with no argument</title>
<updated>2017-12-29T20:45:35Z</updated>
<author>
<name>Daniel Kahn Gillmor</name>
<email>dkg@fifthhorseman.net</email>
</author>
<published>2017-12-25T18:42:26Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=0ada2a05c94de72bc2c7c57a790e92b77af37a42'/>
<id>urn:sha1:0ada2a05c94de72bc2c7c57a790e92b77af37a42</id>
<content type='text'>
We might change some notmuch command line tools that used to be
booleans into keyword arguments.

In that case, there are some legacy tools that will expect to be able
to do "notmuch foo --bar" instead of "notmuch foo --bar=baz".

This patch makes it possible to support that older API, while
providing a warning and an encouragement to upgrade.
</content>
</entry>
<entry>
<title>cli: add support for --no- prefixed boolean and keyword flag arguments</title>
<updated>2017-12-13T12:21:13Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani@nikula.org</email>
</author>
<published>2017-10-14T13:16:06Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=39abd3b5226fef99de1adaa2e8f6b1ba8480c5f5'/>
<id>urn:sha1:39abd3b5226fef99de1adaa2e8f6b1ba8480c5f5</id>
<content type='text'>
Add transparent support for negating boolean and keyword flag
arguments using --no-argument style on the command line. That is, if
the option description contains a boolean or a keyword flag argument
named "argument", --no-argument will match and negate it.

For boolean arguments this obviously means the logical NOT. For
keyword flag arguments this means bitwise AND of the bitwise NOT,
i.e. masking out the specified bits instead of OR'ing them in.

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.

As a curiosity, you should be able to warp your brain using
--no-exclude=true meaning false and --no-exclude=false meaning true if
you wish.

Specifying both "argument" and "no-argument" style arguments in the
same option description should be avoided. In this case, --no-argument
would match whichever is specified first, and --argument would only
match "argument".
</content>
</entry>
<entry>
<title>cli: allow empty strings for notmuch insert --folder argument</title>
<updated>2017-11-08T14:46:44Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani@nikula.org</email>
</author>
<published>2017-10-14T13:15:43Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=733ccfabca350f65a1d0ba1f64792a8a436da273'/>
<id>urn:sha1:733ccfabca350f65a1d0ba1f64792a8a436da273</id>
<content type='text'>
Now that it's easy to add argument specific modifiers in opt
descriptions, add a new .allow_empty field to allow empty strings for
individual string arguments while retaining strict checks
elsewhere. Use this for notmuch insert --folder, where the empty
string means top level folder.
</content>
</entry>
<entry>
<title>cli: convert notmuch_bool_t to stdbool</title>
<updated>2017-10-10T01:24:02Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani@nikula.org</email>
</author>
<published>2017-10-07T08:44:04Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=0f314c0c99befea599a68bea51d759b4133efef6'/>
<id>urn:sha1:0f314c0c99befea599a68bea51d759b4133efef6</id>
<content type='text'>
C99 stdbool turned 18 this year. There really is no reason to use our
own, except in the library interface for backward
compatibility. Convert the cli and test binaries to stdbool.
</content>
</entry>
<entry>
<title>cli: reduce indent in keyword argument processing</title>
<updated>2017-10-05T01:03:52Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani@nikula.org</email>
</author>
<published>2017-10-01T20:53:21Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=288c3660d8798141d86faee30b4394a450dda0ba'/>
<id>urn:sha1:288c3660d8798141d86faee30b4394a450dda0ba</id>
<content type='text'>
Reducing indent makes future changes easier. No functional changes.
</content>
</entry>
<entry>
<title>cli: change while to for in keyword argument processing</title>
<updated>2017-10-05T01:03:21Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani@nikula.org</email>
</author>
<published>2017-10-01T20:53:20Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=4dc3291199055c076b89267c8bf2bdb366c6e635'/>
<id>urn:sha1:4dc3291199055c076b89267c8bf2bdb366c6e635</id>
<content type='text'>
Using a for loop makes it easier to use continue, in preparation for
future changes. No functional changes.
</content>
</entry>
<entry>
<title>cli: refactor boolean argument processing</title>
<updated>2017-10-05T01:03:10Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani@nikula.org</email>
</author>
<published>2017-10-01T20:53:19Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=e70494785541c32989b5c31360e1d9ac57e106ee'/>
<id>urn:sha1:e70494785541c32989b5c31360e1d9ac57e106ee</id>
<content type='text'>
Clean up the control flow to prepare for future changes. No functional
changes.
</content>
</entry>
<entry>
<title>cli: add .present field to opt desc to check if the arg was present</title>
<updated>2017-10-05T01:01:40Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani@nikula.org</email>
</author>
<published>2017-10-01T20:53:14Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=bc99087ff95d0cdada827f3b838d05e0c9448b63'/>
<id>urn:sha1:bc99087ff95d0cdada827f3b838d05e0c9448b63</id>
<content type='text'>
Add pointer to boolean .present field to opt desc, which (if non-NULL)
will be set to TRUE if the argument in question is present on the
command line. Unchanged otherwise.
</content>
</entry>
<entry>
<title>cli: use designated initializers for opt desc</title>
<updated>2017-10-05T01:00:42Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani@nikula.org</email>
</author>
<published>2017-10-01T20:53:11Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=4a6721970a42a9f86149fb5d395d1001fed2d305'/>
<id>urn:sha1:4a6721970a42a9f86149fb5d395d1001fed2d305</id>
<content type='text'>
Several changes at once, just to not have to change the same lines
several times over:

- Use designated initializers to initialize opt desc arrays.

- Only initialize the needed fields.

- Remove arg_id (short options) as unused.

- Replace opt_type and output_var with several type safe output
  variables, where the output variable being non-NULL determines the
  type. Introduce checks to ensure only one is set. The downside is
  some waste of const space per argument; this could be saved by
  retaining opt_type and using a union, but that's still pretty
  verbose.

- Fix some variables due to the type safety. Mostly a good thing, but
  leads to some enums being changed to ints. This is pedantically
  correct, but somewhat annoying. We could also cast, but that defeats
  the purpose a bit.

- Terminate the opt desc arrays using {}.

The output variable type safety and the ability to add new fields for
just some output types or arguments are the big wins. For example, if
we wanted to add a variable to set when the argument is present, we
could do so for just the arguments that need it.

Beauty is in the eye of the beholder, but I think this looks nice when
defining the arguments, and reduces some of the verbosity we have
there.
</content>
</entry>
<entry>
<title>cli: add space separator for keyword, string, and int arguments</title>
<updated>2017-07-12T20:46:29Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2017-07-01T15:18:45Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=a32dd81a55a5d745dbf840b42d03e835a4e1e45c'/>
<id>urn:sha1:a32dd81a55a5d745dbf840b42d03e835a4e1e45c</id>
<content type='text'>
Defer the complication of optional boolean arguments for later (never?).
</content>
</entry>
</feed>
