From b15a03fafc2e313264519f030e45ea203af508e2 Mon Sep 17 00:00:00 2001 From: Mike Kelly Date: Thu, 8 Apr 2010 15:39:38 -0400 Subject: Have notmuch count default to showing the total. 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 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'notmuch-count.c') diff --git a/notmuch-count.c b/notmuch-count.c index 77aa4338..97242aba 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); -- cgit v1.2.3