Patchworkβ A few patches

login
register
about
Submitter Mike Kelly
Date 2010-03-02 03:54:50
Message ID <20100301225450.10bdb8a4@aether.home.pioto.org>
Download mbox | patch
Permalink /patch/404/
State New
Headers show

Comments

Mike Kelly - 2010-03-02 03:54:50
On Mon, 01 Mar 2010 14:13:05 +0100
"Sebastian Spaeth" <Sebastian@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.

Patch

From 861a52ecaf87da6d95aabad05fd4ed3a2609a246 Mon Sep 17 00:00:00 2001
From: Mike Kelly <pioto@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