<feed xmlns='http://www.w3.org/2005/Atom'>
<title>notmuch/notmuch-count.c, branch 0.38.1</title>
<subtitle>thread-based email index, search, and tagging</subtitle>
<id>https://git.notmuchmail.org/git/notmuch/atom?h=0.38.1</id>
<link rel='self' href='https://git.notmuchmail.org/git/notmuch/atom?h=0.38.1'/>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/'/>
<updated>2021-09-05T00:07:19Z</updated>
<entry>
<title>CLI/{count, dump, reindex, reply, show}: enable sexp queries</title>
<updated>2021-09-05T00:07:19Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2021-08-24T15:17:43Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=2944d5913319056dfec5c23065932fd1c87a96f6'/>
<id>urn:sha1:2944d5913319056dfec5c23065932fd1c87a96f6</id>
<content type='text'>
The change in each case is to call notmuch_query_create_with_syntax,
relying on the already inherited shared options.  As a bonus we get
improved error handling from the new query creation API.

The remaining subcommand is 'tag', which is a bit trickier.
</content>
</entry>
<entry>
<title>CLI: make variable n_requested_db_uuid file scope.</title>
<updated>2021-09-05T00:07:19Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2021-08-24T15:17:10Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=d447b694b498c3e18a22f1eb15139a798c6aab26'/>
<id>urn:sha1:d447b694b498c3e18a22f1eb15139a798c6aab26</id>
<content type='text'>
It turns out that now that we pass an open database into the
subcommands, it is easy to check any requested uuid against the
database at the same time as we process the other shared
arguments. This results in overall less boilerplate code, as well as
making a CLI scope function and variable file scope in notmuch.c.
</content>
</entry>
<entry>
<title>CLI: drop notmuch_config_t from subcommand interface.</title>
<updated>2021-04-07T00:32:36Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2021-02-27T14:07:45Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=1c747a501c0ed7df5eaa2b994b9ad11d8981c62c'/>
<id>urn:sha1:1c747a501c0ed7df5eaa2b994b9ad11d8981c62c</id>
<content type='text'>
At this point it is unused in all subcommands.
</content>
</entry>
<entry>
<title>cli: run uncrustify</title>
<updated>2021-03-13T12:45:34Z</updated>
<author>
<name>uncrustify</name>
<email>david@tethera.net</email>
</author>
<published>2021-03-13T12:45:34Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=eef21c284742fa5ae14d7d352acc3a4dc98821ce'/>
<id>urn:sha1:eef21c284742fa5ae14d7d352acc3a4dc98821ce</id>
<content type='text'>
This is the result of running

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

in the top level source directory

Line breaks were then adjusted manually to keep argc and argv
together.
</content>
</entry>
<entry>
<title>CLI/count: switch to new configuration framework</title>
<updated>2021-02-06T23:11:06Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2020-12-22T12:13:51Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=acc6331baa41a8aa7025924c823251d8f8c3384f'/>
<id>urn:sha1:acc6331baa41a8aa7025924c823251d8f8c3384f</id>
<content type='text'>
The main effort is changing from the old argv style config list
iterators to the new more opaque ones provided by the library (and
backed by the database+file config cache).
</content>
</entry>
<entry>
<title>CLI: add (unused) database argument to subcommands.</title>
<updated>2021-02-06T23:05:19Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2020-12-21T12:55:14Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=319efe21c9d2754c99951cecc71184faf7ca9054'/>
<id>urn:sha1:319efe21c9d2754c99951cecc71184faf7ca9054</id>
<content type='text'>
This will allow transitioning individual subcommands to the new
configuration framework. Eventually when they are all converted we can
remove the notmuch_config_t * argument.

For now, live with the parameter shadowing in some some subcommands;
it will go away when they are converted.
</content>
</entry>
<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: make notmuch count --exclude a boolean argument</title>
<updated>2017-10-15T22:22:40Z</updated>
<author>
<name>Jani Nikula</name>
<email>jani@nikula.org</email>
</author>
<published>2017-10-14T20:18:36Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=ab8b40f7e350c0661dda5b9d52041150ed339a39'/>
<id>urn:sha1:ab8b40f7e350c0661dda5b9d52041150ed339a39</id>
<content type='text'>
Commit 0f314c0c99be ("cli: convert notmuch_bool_t to stdbool")
over-eagerly converted EXCLUDE_TRUE and EXCLUDE_FALSE to EXCLUDE_true
and EXCLUDE_false in notmuch-count.c. We could just fix the case back,
but convert the option to an actual boolean argument instead.

We've used a keyword argument rather than a boolean argument for
notmuch count --exclude for five years, since commit 785c1e497f05
("cli: move count to the new --exclude=(true|false|flag) naming
scheme."), "to allow future options to be added more easily". I think
we can conclude future options aren't coming any time soon.
</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: 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>
</feed>
