diff options
author | Keith Packard <keithp@keithp.com> | 2009-11-20 23:15:07 -0800 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2009-11-23 06:33:54 +0100 |
commit | 53f8cc565126db4a003dbfc02850d2bf3b260636 (patch) | |
tree | 9797fb6cd1acfc5070bc7ede019772f356fee522 /notmuch.c | |
parent | 43daa6f070f962959bf26fa49a860f528b2bbfa1 (diff) |
Add 'notmuch count' command to show the count of matching messages
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>
Diffstat (limited to 'notmuch.c')
-rw-r--r-- | notmuch.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -187,6 +187,17 @@ command_t commands[] = { "\n" "\t\tSee \"notmuch help search-terms\" for details of the search\n" "\t\tterms syntax." }, + { "count", notmuch_count_command, + "<search-terms> [...]", + "\t\tCount messages matching the search terms.", + "\t\tThe number of matching messages is output to stdout.\n" + "\n" + "\t\tA common use of \"notmuch count\" is to display the count\n" + "\t\tof messages matching both a specific tag and either inbox\n" + "\t\tor unread\n" + "\n" + "\t\tSee \"notmuch help search-terms\" for details of the search\n" + "\t\tterms syntax." }, { "reply", notmuch_reply_command, "<search-terms> [...]", "\t\tConstruct a reply template for a set of messages.", |