On Mon, 01 Mar 2010 14:13:05 +0100
"Sebastian Spaeth" <sebast...@sspaeth.de> wrote:

> > > to count everything. Anyone have a better option for what the
> > > give-me-everything syntax should be?
> > 
> > notmuch count ''
> > 
> > The search patterns limit the matched messages/folders. An empty
> > pattern should match everything.
> 
> I agree that '' should work, but then I would expect to have '*' work
> as well. Is there a reason not to have both at the same time? Both
> make sense.

Try out this patch. It works both ways.

-- 
Mike Kelly

From 861a52ecaf87da6d95aabad05fd4ed3a2609a246 Mon Sep 17 00:00:00 2001
From: Mike Kelly <pi...@pioto.org>
Date: Mon, 1 Mar 2010 22:51:44 -0500
Subject: [PATCH] Support notmuch-count with no args, '', or '*'

All of these will return the total count of messages.
---
 notmuch-count.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/notmuch-count.c b/notmuch-count.c
index cc84a69..97242ab 100644
--- a/notmuch-count.c
+++ b/notmuch-count.c
@@ -90,7 +90,7 @@ notmuch_count_command (void *ctx, int argc, char *argv[])
 	fprintf (stderr, "Out of memory.\n");
 	return 1;
     }
-    if (*query_str == '\0') {
+    if (*query_str == '\0' || (*query_str == '*' && *(query_str+1) == '\0')) {
 	query_str = talloc_strdup (ctx, "");
     }
 
-- 
1.7.0.1

Attachment: signature.asc
Description: PGP signature

_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch

Reply via email to