<feed xmlns='http://www.w3.org/2005/Atom'>
<title>notmuch/command-line-arguments.h, branch 0.39_rc2</title>
<subtitle>thread-based email index, search, and tagging</subtitle>
<id>https://git.notmuchmail.org/git/notmuch/atom?h=0.39_rc2</id>
<link rel='self' href='https://git.notmuchmail.org/git/notmuch/atom?h=0.39_rc2'/>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/'/>
<updated>2019-06-14T10:41:27Z</updated>
<entry>
<title>cli: run uncrustify</title>
<updated>2019-06-14T10:41:27Z</updated>
<author>
<name>uncrustify</name>
<email>david@tethera.net</email>
</author>
<published>2019-06-13T10:31:01Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=33382c2b5ba2537952a60ea378feff36961e4713'/>
<id>urn:sha1:33382c2b5ba2537952a60ea378feff36961e4713</id>
<content type='text'>
This is the result of running

     $ uncrustify --replace --config devel/uncrustify.cfg *.c *.h

in the top level source directory
</content>
</entry>
<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: 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: 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: change api of parse_option</title>
<updated>2017-07-12T20:44:15Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2017-07-01T15:18:44Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=de9baa29dc990e4166b47dc2b0d0cf560014834b'/>
<id>urn:sha1:de9baa29dc990e4166b47dc2b0d0cf560014834b</id>
<content type='text'>
The idea is to allow it (in a future commit) advance to the next argv
element to get a value
</content>
</entry>
<entry>
<title>cli: add support for hierarchical command line option arrays</title>
<updated>2014-11-05T22:17:00Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani@nikula.org</email>
</author>
<published>2014-11-05T00:25:54Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=4387112de00d27e6957ca2b6a268242f0bb5c756'/>
<id>urn:sha1:4387112de00d27e6957ca2b6a268242f0bb5c756</id>
<content type='text'>
NOTMUCH_OPT_INHERIT expects a notmuch_opt_desc_t * pointer in
output_var.

The "Unrecognized option" message was moved out of parse_option() to
not be emitted twice or when parsing a non-inherited option.
</content>
</entry>
<entry>
<title>cli: Add support for parsing keyword-flag arguments</title>
<updated>2014-11-01T07:02:21Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani@nikula.org</email>
</author>
<published>2014-10-31T21:53:56Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=ecc4a9a6441a3b7011d9afb2ca67e9d4ea1fca48'/>
<id>urn:sha1:ecc4a9a6441a3b7011d9afb2ca67e9d4ea1fca48</id>
<content type='text'>
This allows having multiple --foo=bar --foo=baz options on the command
line, with the corresponding values OR'd together.

[Test added by Michal Sojka]
</content>
</entry>
<entry>
<title>command-line-arguments.[ch]: make arrays of keyword descriptors const</title>
<updated>2011-12-13T04:00:44Z</updated>
<author>
<name>David Bremner</name>
<email>bremner@debian.org</email>
</author>
<published>2011-12-13T03:54:24Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=f717d2ece1836c863f9cc02abd1ff2539307cd1d'/>
<id>urn:sha1:f717d2ece1836c863f9cc02abd1ff2539307cd1d</id>
<content type='text'>
It seems like it should never be necessary to modify these arrays after
initialization.
</content>
</entry>
</feed>
