<feed xmlns='http://www.w3.org/2005/Atom'>
<title>notmuch/test/arg-test.c, branch master</title>
<subtitle>thread-based email index, search, and tagging</subtitle>
<id>https://git.notmuchmail.org/git/notmuch/atom?h=master</id>
<link rel='self' href='https://git.notmuchmail.org/git/notmuch/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/'/>
<updated>2019-06-29T19:18:15Z</updated>
<entry>
<title>test: run uncrustify</title>
<updated>2019-06-29T19:18:15Z</updated>
<author>
<name>Daniel Kahn Gillmor</name>
<email>dkg@fifthhorseman.net</email>
</author>
<published>2019-06-25T17:55:45Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=bdc87f0d3ec41dd4744a89d1d19b2186d0647a56'/>
<id>urn:sha1:bdc87f0d3ec41dd4744a89d1d19b2186d0647a56</id>
<content type='text'>
This is the result of running:

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

in the test directory.

Signed-off-by: Daniel Kahn Gillmor &lt;dkg@fifthhorseman.net&gt;
</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: 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>test: expand argument parsing tests</title>
<updated>2017-10-05T01:01:50Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani@nikula.org</email>
</author>
<published>2017-10-01T20:53:15Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=9165df21359cc5e93ddeb16bf9623a03441bed62'/>
<id>urn:sha1:9165df21359cc5e93ddeb16bf9623a03441bed62</id>
<content type='text'>
Test and use the new .present field, only output the parameters
given. Test space between parameter name and value.
</content>
</entry>
<entry>
<title>test: add opt_inherit to arg-test</title>
<updated>2017-10-05T01:01:15Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani@nikula.org</email>
</author>
<published>2017-10-01T20:53:13Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=25960b5ecdc6374fc87a3cb12c1c393497b262da'/>
<id>urn:sha1:25960b5ecdc6374fc87a3cb12c1c393497b262da</id>
<content type='text'>
Just split the arguments to two opt desc arrays.
</content>
</entry>
<entry>
<title>test: add boolean argument to arg-test</title>
<updated>2017-10-05T01:00:54Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani@nikula.org</email>
</author>
<published>2017-10-01T20:53:12Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=e8cba9da18a8ed946738fdd9f47d117c1110c1b4'/>
<id>urn:sha1:e8cba9da18a8ed946738fdd9f47d117c1110c1b4</id>
<content type='text'>
Surprisingly it's not there.
</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 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>test: fix an evident copy-paste error in argument parsing test</title>
<updated>2012-12-04T13:07:32Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani@nikula.org</email>
</author>
<published>2012-12-03T22:54:52Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=7f54db1f04f6d0d0e7edc917ea634badd5d4d679'/>
<id>urn:sha1:7f54db1f04f6d0d0e7edc917ea634badd5d4d679</id>
<content type='text'>
</content>
</entry>
<entry>
<title>test: tests for command-line-arguments.c</title>
<updated>2011-12-09T00:24:24Z</updated>
<author>
<name>David Bremner</name>
<email>bremner@debian.org</email>
</author>
<published>2011-12-07T18:37:13Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=5800a44bd5b77390d2243426f0c82de4d0495a1c'/>
<id>urn:sha1:5800a44bd5b77390d2243426f0c82de4d0495a1c</id>
<content type='text'>
This was needed because no current notmuch code exercises the
NOTMUCH_OPT_STRING style arguments.
</content>
</entry>
</feed>
