aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch-search.c
diff options
context:
space:
mode:
authorGravatar Mark Walters <markwalters1009@gmail.com>2012-03-01 22:30:33 +0000
committerGravatar David Bremner <bremner@debian.org>2012-03-02 08:24:38 -0400
commitd845662970c7627a7c6d03d4698119c2263c586f (patch)
tree4abeedce15f20e97509089d06026d3952d9ece84 /notmuch-search.c
parent4fa77d031838db923dec29024df638520586c925 (diff)
cli: add --no-exclude option to count and search.
This option turns off the exclusion so all matching messages are returned. We do not need to add this to notmuch-show as that does not (yet) exclude.
Diffstat (limited to 'notmuch-search.c')
-rw-r--r--notmuch-search.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/notmuch-search.c b/notmuch-search.c
index 92ce38a1..6d6c0e60 100644
--- a/notmuch-search.c
+++ b/notmuch-search.c
@@ -426,8 +426,7 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
output_t output = OUTPUT_SUMMARY;
int offset = 0;
int limit = -1; /* unlimited */
- const char **search_exclude_tags;
- size_t search_exclude_tags_length;
+ notmuch_bool_t no_exclude = FALSE;
unsigned int i;
enum { NOTMUCH_FORMAT_JSON, NOTMUCH_FORMAT_TEXT }
@@ -449,6 +448,7 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
{ "files", OUTPUT_FILES },
{ "tags", OUTPUT_TAGS },
{ 0, 0 } } },
+ { NOTMUCH_OPT_BOOLEAN, &no_exclude, "no-exclude", 'd', 0 },
{ NOTMUCH_OPT_INT, &offset, "offset", 'O', 0 },
{ NOTMUCH_OPT_INT, &limit, "limit", 'L', 0 },
{ 0, 0, 0, 0, 0 }
@@ -496,10 +496,15 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
notmuch_query_set_sort (query, sort);
- search_exclude_tags = notmuch_config_get_search_exclude_tags
- (config, &search_exclude_tags_length);
- for (i = 0; i < search_exclude_tags_length; i++)
- notmuch_query_add_tag_exclude (query, search_exclude_tags[i]);
+ if (!no_exclude) {
+ const char **search_exclude_tags;
+ size_t search_exclude_tags_length;
+
+ search_exclude_tags = notmuch_config_get_search_exclude_tags
+ (config, &search_exclude_tags_length);
+ for (i = 0; i < search_exclude_tags_length; i++)
+ notmuch_query_add_tag_exclude (query, search_exclude_tags[i]);
+ }
switch (output) {
default: