1 Return-Path: <markwalters1009@gmail.com>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 53D29431FAE
\r
6 for <notmuch@notmuchmail.org>; Thu, 15 Mar 2012 11:42:19 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,
\r
14 RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id gR2Y4+h+pg8d for <notmuch@notmuchmail.org>;
\r
18 Thu, 15 Mar 2012 11:42:17 -0700 (PDT)
\r
19 Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com
\r
20 [209.85.212.179]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
21 (No client certificate requested)
\r
22 by olra.theworths.org (Postfix) with ESMTPS id 376D2431FD9
\r
23 for <notmuch@notmuchmail.org>; Thu, 15 Mar 2012 11:42:15 -0700 (PDT)
\r
24 Received: by wibhn6 with SMTP id hn6so3844513wib.2
\r
25 for <notmuch@notmuchmail.org>; Thu, 15 Mar 2012 11:42:14 -0700 (PDT)
\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
27 h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;
\r
28 bh=SucZmu96ju3u3RJTCQuUddOVVmItNMCvybI0YGQHork=;
\r
29 b=qupk2mCm4832ZZNrKYY3J2TT0mPtKb1ozXv79VjjU5KAMzXFGSDFVquYs9Ani+ANQb
\r
30 I5v9qmQzKKTZtDa7VVnGswkCEeWvmmm8Vou/KVbaf8al2It1BeBTWB3U0qoK8IBS/TCP
\r
31 ylMDgzjcxCnzGLp57evYGrlmvhrOdkdM1SuUpJ2+55th6VKoThT86/PLZ7kPQvsTHMHb
\r
32 lnzInDK6EBMXX/k30Ep3yYJVOh0pBICnX4Xyg2/FylO8KBhg383k0JD+5LyobXCmmLw9
\r
33 KgBq+ZXvUqj9PT09gq52TO7r0QMxjINjChZy0f9qaM5awZL0M+qS++2vZ5w2F540Rq/F
\r
35 Received: by 10.180.89.9 with SMTP id bk9mr3333447wib.11.1331836933970;
\r
36 Thu, 15 Mar 2012 11:42:13 -0700 (PDT)
\r
37 Received: from localhost (94-192-233-223.zone6.bethere.co.uk.
\r
38 [94.192.233.223]) by mx.google.com with ESMTPS id
\r
39 be4sm11392195wib.8.2012.03.15.11.42.12 (version=TLSv1/SSLv3 cipher=OTHER);
\r
40 Thu, 15 Mar 2012 11:42:13 -0700 (PDT)
\r
41 From: Mark Walters <markwalters1009@gmail.com>
\r
42 To: notmuch@notmuchmail.org
\r
43 Subject: [PATCH 2/5] cli: move count to the new --exclude=(true|false|flag)
\r
45 Date: Thu, 15 Mar 2012 18:42:02 +0000
\r
46 Message-Id: <1331836925-31437-3-git-send-email-markwalters1009@gmail.com>
\r
47 X-Mailer: git-send-email 1.7.9.1
\r
48 In-Reply-To: <1331836925-31437-1-git-send-email-markwalters1009@gmail.com>
\r
49 References: <1331836925-31437-1-git-send-email-markwalters1009@gmail.com>
\r
50 X-BeenThere: notmuch@notmuchmail.org
\r
51 X-Mailman-Version: 2.1.13
\r
53 List-Id: "Use and development of the notmuch mail system."
\r
54 <notmuch.notmuchmail.org>
\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
56 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
58 List-Post: <mailto:notmuch@notmuchmail.org>
\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
61 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
62 X-List-Received-Date: Thu, 15 Mar 2012 18:42:19 -0000
\r
64 Move the option --no-exclude to the --exclude= scheme. Since there is
\r
65 no way to flag messages only true and false are implemented. Note
\r
66 that, for consistency with other commands, this is implemented as a
\r
67 keyword option rather than a boolean option.
\r
69 man/man1/notmuch-count.1 | 5 +++--
\r
70 notmuch-count.c | 17 ++++++++++++-----
\r
72 3 files changed, 17 insertions(+), 9 deletions(-)
\r
74 diff --git a/man/man1/notmuch-count.1 b/man/man1/notmuch-count.1
\r
75 index 805a8ae..b169f93 100644
\r
76 --- a/man/man1/notmuch-count.1
\r
77 +++ b/man/man1/notmuch-count.1
\r
78 @@ -41,9 +41,10 @@ Output the number of matching threads.
\r
82 -.BR \-\-no\-exclude
\r
83 +.BR \-\-exclude=(true|false)
\r
85 -Do not exclude the messages matching search.exclude_tags in the config file.
\r
86 +Specify whether to omit messages matching search.tag_exclude from the
\r
87 +count (the default) or not.
\r
91 diff --git a/notmuch-count.c b/notmuch-count.c
\r
92 index 46b76ae..b76690c 100644
\r
93 --- a/notmuch-count.c
\r
94 +++ b/notmuch-count.c
\r
95 @@ -26,6 +26,12 @@ enum {
\r
99 +/* The following is to allow future options to be added more easily */
\r
106 notmuch_count_command (void *ctx, int argc, char *argv[])
\r
108 @@ -35,7 +41,7 @@ notmuch_count_command (void *ctx, int argc, char *argv[])
\r
111 int output = OUTPUT_MESSAGES;
\r
112 - notmuch_bool_t no_exclude = FALSE;
\r
113 + int exclude = EXCLUDE_TRUE;
\r
116 notmuch_opt_desc_t options[] = {
\r
117 @@ -43,7 +49,10 @@ notmuch_count_command (void *ctx, int argc, char *argv[])
\r
118 (notmuch_keyword_t []){ { "threads", OUTPUT_THREADS },
\r
119 { "messages", OUTPUT_MESSAGES },
\r
121 - { NOTMUCH_OPT_BOOLEAN, &no_exclude, "no-exclude", 'd', 0 },
\r
122 + { NOTMUCH_OPT_KEYWORD, &exclude, "exclude", 'x',
\r
123 + (notmuch_keyword_t []){ { "true", EXCLUDE_TRUE },
\r
124 + { "false", EXCLUDE_FALSE },
\r
129 @@ -78,7 +87,7 @@ notmuch_count_command (void *ctx, int argc, char *argv[])
\r
133 - if (!no_exclude) {
\r
134 + if (exclude == EXCLUDE_TRUE) {
\r
135 const char **search_exclude_tags;
\r
136 size_t search_exclude_tags_length;
\r
138 @@ -88,8 +97,6 @@ notmuch_count_command (void *ctx, int argc, char *argv[])
\r
139 notmuch_query_add_tag_exclude (query, search_exclude_tags[i]);
\r
142 - notmuch_query_set_omit_excluded_messages (query, TRUE);
\r
145 case OUTPUT_MESSAGES:
\r
146 printf ("%u\n", notmuch_query_count_messages (query));
\r
147 diff --git a/test/count b/test/count
\r
148 index b97fc06..fd387e5 100755
\r
151 @@ -53,9 +53,9 @@ test_expect_equal \
\r
153 "`notmuch count subject:deleted and tag:deleted`"
\r
155 -test_begin_subtest "count \"deleted\" messages, with --no-exclude"
\r
156 +test_begin_subtest "count \"deleted\" messages, --exclude=false"
\r
157 test_expect_equal \
\r
159 - "`notmuch count --no-exclude subject:deleted`"
\r
160 + "`notmuch count --exclude=false subject:deleted`"
\r