unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] Have notmuch count default to showing the total.
@ 2010-04-08 19:39 Mike Kelly
  2010-04-09 13:01 ` Sebastian Spaeth
  2010-04-10  0:48 ` Carl Worth
  0 siblings, 2 replies; 9+ messages in thread
From: Mike Kelly @ 2010-04-08 19:39 UTC (permalink / raw)
  To: notmuch

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
---
 notmuch-count.c |    5 ++---
 notmuch.c       |    4 ++++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/notmuch-count.c b/notmuch-count.c
index 77aa433..97242ab 100644
--- a/notmuch-count.c
+++ b/notmuch-count.c
@@ -90,9 +90,8 @@ notmuch_count_command (void *ctx, int argc, char *argv[])
 	fprintf (stderr, "Out of memory.\n");
 	return 1;
     }
-    if (*query_str == '\0') {
-	fprintf (stderr, "Error: notmuch count requires at least one count term.\n");
-	return 1;
+    if (*query_str == '\0' || (*query_str == '*' && *(query_str+1) == '\0')) {
+	query_str = talloc_strdup (ctx, "");
     }
 
     query = notmuch_query_create (notmuch, query_str);
diff --git a/notmuch.c b/notmuch.c
index f5669fc..8650951 100644
--- a/notmuch.c
+++ b/notmuch.c
@@ -220,6 +220,10 @@ command_t commands[] = {
       "\tof messages matching both a specific tag and either inbox\n"
       "\tor unread\n"
       "\n"
+      "\tIf no parameters are given, or the special search terms '' or\n"
+      "\t'*' are given, it will display the total number of messages in\n"
+      "\tthe database.\n"
+      "\n"
       "\tSee \"notmuch help search-terms\" for details of the search\n"
       "\t\tterms syntax." },
     { "reply", notmuch_reply_command,
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-04-10  0:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-08 19:39 [PATCH] Have notmuch count default to showing the total Mike Kelly
2010-04-09 13:01 ` Sebastian Spaeth
2010-04-09 17:19   ` Dirk Hohndel
2010-04-09 23:33     ` Carl Worth
2010-04-09 19:28   ` Anthony Towns
2010-04-09 19:39     ` Mark Anderson
2010-04-09 20:07     ` Jameson Rollins
2010-04-09 20:19     ` Mike Kelly
2010-04-10  0:48 ` Carl Worth

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).