Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 68082431FC0 for ; Wed, 20 Jun 2012 06:29:38 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hDcrxwT93ZB2 for ; Wed, 20 Jun 2012 06:29:38 -0700 (PDT) Received: from mail-pz0-f53.google.com (mail-pz0-f53.google.com [209.85.210.53]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id D0938431FAF for ; Wed, 20 Jun 2012 06:29:37 -0700 (PDT) Received: by mail-pz0-f53.google.com with SMTP id g9so12291942dad.26 for ; Wed, 20 Jun 2012 06:29:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=P/4DMCW/lNuO8mr62zv8MknP/3u1G8WgL+koyerSrPA=; b=0OgTnGDrOs635HxV/d9ai3z8sq+/9r4jFhw1fsBUkfyJ7/ZzGYmupn9hVFYf7dOJmI 2assmvTOweXTqnYgMX1V3ShALPPXbN3JYw2t3on+oRmeg/EZkRHLl/Dh4gicXGv4NJy0 +tdbRyNr4NHkpBy61CA9ODxYMoyYPS7LWg0xtZZSg0U2WOe1bGv0VbuRyQqe7uGQo/Qh dVBS4Bddy2U0aa0x9G5Q8Gm17sgfIZo4KVRKM9NgH/vrwi79Uv67Pjut8oKcsZJcWtZd jNHgdhG0DUXzbMW7R89+hsFIahlM4PRk+C8EWRfl68Nzam42oAHkvT27c0PN0bmld/j9 /Sxw== Received: by 10.68.221.10 with SMTP id qa10mr74949437pbc.154.1340198976334; Wed, 20 Jun 2012 06:29:36 -0700 (PDT) Received: from localhost (215.42.233.220.static.exetel.com.au. [220.233.42.215]) by mx.google.com with ESMTPS id hb5sm31927706pbc.58.2012.06.20.06.29.33 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 20 Jun 2012 06:29:35 -0700 (PDT) From: Peter Wang To: notmuch@notmuchmail.org Subject: [PATCH 2/8] cli: add --exclude=all option to notmuch-search.c Date: Wed, 20 Jun 2012 23:29:01 +1000 Message-Id: <1340198947-29370-3-git-send-email-novalazy@gmail.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1340198947-29370-1-git-send-email-novalazy@gmail.com> References: <1340198947-29370-1-git-send-email-novalazy@gmail.com> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 13:29:38 -0000 From: Mark Walters Add a --exclude=all option to notmuch search. --- notmuch-search.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/notmuch-search.c b/notmuch-search.c index 3be296d..89b5bf9 100644 --- a/notmuch-search.c +++ b/notmuch-search.c @@ -420,6 +420,7 @@ enum { EXCLUDE_TRUE, EXCLUDE_FALSE, EXCLUDE_FLAG, + EXCLUDE_ALL }; int @@ -461,6 +462,7 @@ notmuch_search_command (void *ctx, 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 }, @@ -516,7 +518,7 @@ notmuch_search_command (void *ctx, 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; @@ -525,7 +527,9 @@ notmuch_search_command (void *ctx, 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) { -- 1.7.4.4