aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch-count.c
Commit message (Collapse)AuthorAge
* cli: clean up exit status code returned by the cli commandsGravatar Jani Nikula2014-01-18
| | | | | | Apart from the status codes for format mismatches, the non-zero exit status codes have been arbitrary. Make the cli consistently return either EXIT_SUCCESS or EXIT_FAILURE.
* cli: add --output=files option to notmuch countGravatar Jani Nikula2013-08-24
| | | | | | Add support for querying the total number of files associated with the messages matching the search. This is mostly useful with an id:<message-id> query for a single message.
* cli: add --batch option to notmuch countGravatar Jani Nikula2013-04-01
| | | | | | | | Add support for reading queries from stdin, one per line, and writing results to stdout, one per line. This will bring considerable performance improvements when utilized in Emacs notmuch-hello, especially so when running remote notmuch.
* cli: extract count printing to a separate function in notmuch countGravatar Jani Nikula2013-04-01
| | | | Make count printing on a query string reusable. No functional changes.
* cli: remove useless talloc_strdupGravatar Jani Nikula2013-04-01
| | | | | If the condition holds, query_string_from_args() has already returned a talloc allocated empty string. There's no need to duplicate that.
* cli: move config open/close to main() from subcommandsGravatar Jani Nikula2013-03-08
| | | | | | | | | | | | | This allows specifying config file as a top level argument to notmuch, and generally makes it possible to override config file options in main(), without having to touch the subcommands. If the config file does not exist, one will be created for the notmuch main command and setup and help subcommands. Help is special in this regard; the config is created just to avoid errors about missing config, but it will not be saved. This also makes notmuch config the talloc context for subcommands.
* cli: config: make notmuch_config_open() "is new" parameter input onlyGravatar Jani Nikula2013-03-07
| | | | | | | | We now have a notmuch_config_is_new() function to query whether a config was created or not. Change the notmuch_config_open() is_new parameter into boolean create_new to determine whether the function should create a new config if one doesn't exist. This reduces the complexity of the API.
* lib/cli: Make notmuch_database_open return a status codeGravatar Austin Clements2012-05-05
| | | | | | | | | | | | It has been a long-standing issue that notmuch_database_open doesn't return any indication of why it failed. This patch changes its prototype to return a notmuch_status_t and set an out-argument to the database itself, like other functions that return both a status and an object. In the interest of atomicity, this also updates every use in the CLI so that notmuch still compiles. Since this patch does not update the bindings, the Python bindings test fails.
* Use notmuch_database_destroy instead of notmuch_database_closeGravatar Justus Winter2012-04-28
| | | | | | Adapt the notmuch binaries source to the notmuch_database_close split. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* cli: move count to the new --exclude=(true|false|flag) naming scheme.Gravatar Mark Walters2012-04-07
| | | | | | | Move the option --no-exclude to the --exclude= scheme. Since there is no way to flag messages only true and false are implemented. Note that, for consistency with other commands, this is implemented as a keyword option rather than a boolean option.
* cli: omit excluded messages in results where appropriate.Gravatar Mark Walters2012-03-02
| | | | | | | | | | | | | In all cases of notmuch count/search/show where the results returned cannot reflect the exclude flag return just the matched not-excluded results. If the caller wishes to have all the matched results (i.e., including the excluded ones) they should call with the --no-exclude option. The relevant cases are count: both threads and messages search: all cases except the summary view show: mbox format
* cli: add --no-exclude option to count and search.Gravatar Mark Walters2012-03-02
| | | | | | This option turns off the exclusion so all matching messages are returned. We do not need to add this to notmuch-show as that does not (yet) exclude.
* search: rename auto_exclude_tags to {search, }exclude_tagsGravatar Pieter Praet2012-01-23
| | | | | | | All other config-related functions and args include the section title in their name, so for the sake of consistency, mirror that. Also, the "auto"matic part is a given, so that was dropped.
* search: Support automatic tag exclusionsGravatar Austin Clements2012-01-16
| | | | | | This adds a "search" section to the config file and an "auto_tag_exclusions" setting in that section. The search and count commands pass tag tags from the configuration to the library.
* count: Convert to new-style argument parsingGravatar Austin Clements2012-01-13
|
* cli: add support for --output parameter in notmuch countGravatar Jani Nikula2011-11-15
| | | | | | | Add support for --output=messages (which remains the default) and --output=threads to notmuch count. Signed-off-by: Jani Nikula <jani@nikula.org>
* cli: drop unused code from notmuch countGravatar Jani Nikula2011-11-15
| | | | | | Remove unused code within #if 0 blocks from notmuch count. Signed-off-by: Jani Nikula <jani@nikula.org>
* cli: change argument parsing convention for subcommandsGravatar David Bremner2011-10-22
| | | | | | | | | previously we deleted the subcommand name from argv before passing to the subcommand. In this version, the deletion is done in the actual subcommands. Although this causes some duplication of code, it allows us to be more flexible about how we parse command line arguments in the subcommand, including possibly using off-the-shelf routines like getopt_long that expect the name of the command in argv[0].
* notmuch count: Remove special handling of "*".Gravatar Carl Worth2010-04-09
| | | | | | From both the implementation and from the documentation. This is handled generically in the library for all search-based commands, so count doesn't need special treatment.
* Have notmuch count default to showing the total.Gravatar Mike Kelly2010-04-09
| | | | | | | If no parameters are given to notmuch-count, or just '' or '*' are given, return the total number of messages in the database. update notmuch count help
* Add 'notmuch count' command to show the count of matching messagesGravatar Keith Packard2009-11-23
Getting the count of matching threads or messages is a fairly expensive operation. Xapian provides a very efficient mechanism that returns an approximate value, so use that for this new command. This returns the number of matching messages, not threads, as that is cheap to compute. Signed-off-by: Keith Packard <keithp@keithp.com>