aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch-search.c
diff options
context:
space:
mode:
authorGravatar Mark Walters <markwalters1009@gmail.com>2013-05-11 20:50:03 +0100
committerGravatar David Bremner <bremner@unb.ca>2013-05-13 21:32:14 -0300
commite691783b3b9d564c390f5ebb2e0e4be348ec16ef (patch)
treebfda77152e637b9b56cb24698f7ef29f3a8b50db /notmuch-search.c
parent38698d86596af64fa25c118dafef0249155ca7a4 (diff)
cli: add --exclude=all option to notmuch-search.c
Add a --exclude=all option to notmuch search.
Diffstat (limited to 'notmuch-search.c')
-rw-r--r--notmuch-search.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/notmuch-search.c b/notmuch-search.c
index e6586397..43232011 100644
--- a/notmuch-search.c
+++ b/notmuch-search.c
@@ -287,6 +287,7 @@ enum {
EXCLUDE_TRUE,
EXCLUDE_FALSE,
EXCLUDE_FLAG,
+ EXCLUDE_ALL
};
int
@@ -334,6 +335,7 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[])
(notmuch_keyword_t []){ { "true", EXCLUDE_TRUE },
{ "false", EXCLUDE_FALSE },
{ "flag", EXCLUDE_FLAG },
+ { "all", EXCLUDE_ALL },
{ 0, 0 } } },
{ NOTMUCH_OPT_INT, &offset, "offset", 'O', 0 },
{ NOTMUCH_OPT_INT, &limit, "limit", 'L', 0 },
@@ -400,7 +402,7 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[])
exclude = EXCLUDE_FALSE;
}
- if (exclude == EXCLUDE_TRUE || exclude == EXCLUDE_FLAG) {
+ if (exclude != EXCLUDE_FALSE) {
const char **search_exclude_tags;
size_t search_exclude_tags_length;
@@ -409,7 +411,9 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[])
for (i = 0; i < search_exclude_tags_length; i++)
notmuch_query_add_tag_exclude (query, search_exclude_tags[i]);
if (exclude == EXCLUDE_FLAG)
- notmuch_query_set_omit_excluded (query, FALSE);
+ notmuch_query_set_omit_excluded (query, NOTMUCH_EXCLUDE_FALSE);
+ if (exclude == EXCLUDE_ALL)
+ notmuch_query_set_omit_excluded (query, NOTMUCH_EXCLUDE_ALL);
}
switch (output) {