From: Jani Nikula Date: Wed, 29 Oct 2014 19:30:43 +0000 (+0200) Subject: [PATCH] cli: notmuch search --duplicate=N is only supported with --output=files X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4e57b1675854a5fa8237329ea766a3d2b52d4cd1;p=notmuch-archives.git [PATCH] cli: notmuch search --duplicate=N is only supported with --output=files --- diff --git a/97/80824e472b0dcd32019fa9cd9c58148c3bfc81 b/97/80824e472b0dcd32019fa9cd9c58148c3bfc81 new file mode 100644 index 000000000..39106cd50 --- /dev/null +++ b/97/80824e472b0dcd32019fa9cd9c58148c3bfc81 @@ -0,0 +1,91 @@ +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 1D986431FC2 + for ; Wed, 29 Oct 2014 12:30:54 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[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 JlQhLdMvkwth for ; + Wed, 29 Oct 2014 12:30:48 -0700 (PDT) +Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com + [209.85.212.179]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 6AC63431FB6 + for ; Wed, 29 Oct 2014 12:30:48 -0700 (PDT) +Received: by mail-wi0-f179.google.com with SMTP id h11so5530626wiw.6 + for ; Wed, 29 Oct 2014 12:30:47 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to + :references; + bh=iAAuSExP8hbOWzlE7iHCzhc8CgYzLwBQ/o9sLRpzjNk=; + b=ZjgFRHo9D71IM+ACir5yv7DcI7wzeFCWLm6fe3KngD5JJTZ8dTzX8WYuJ+JSn/W48g + CnQAMidPbzzCn0jrVx8e78+zP+N1g8vEhoyXsYppTWuh6zS0e6uXdAzy71YBD75TJd6k + 3hfV92LwqtZMDocEL+0gp0ClLtdAdQDy/i5HLlzL9wiraDk4s+w8OEBirZmCVuBD6HRI + UyDoWmo7IMPvnk/xGCXLYP9lXkarKHJk9VrMIZJOgTZnF8LiSqSAP3vFxxDPbqT/uPB6 + 0kW3DE44fnIvPFYYYWtd3PhXKPESidRYEzqlM2uGgp5Xq6ay2UEuK9NYGywAWl07XydK + mfew== +X-Gm-Message-State: + ALoCoQkFucPWG3Mb1vqyNz/NRO97Q4SlmVhYpnYZRzYGj3VarPe1Ga3XinH9NeqvuwtkKvPw1Bxy +X-Received: by 10.180.79.169 with SMTP id k9mr15232832wix.34.1414611047032; + Wed, 29 Oct 2014 12:30:47 -0700 (PDT) +Received: from localhost (dsl-hkibrasgw2-58c36d-48.dhcp.inet.fi. + [88.195.109.48]) by mx.google.com with ESMTPSA id + bg10sm6166259wjc.47.2014.10.29.12.30.45 for + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Wed, 29 Oct 2014 12:30:46 -0700 (PDT) +From: Jani Nikula +To: notmuch@notmuchmail.org, + David Edmondson +Subject: [PATCH] cli: notmuch search --duplicate=N is only supported with + --output=files +Date: Wed, 29 Oct 2014 21:30:43 +0200 +Message-Id: <1414611043-3498-1-git-send-email-jani@nikula.org> +X-Mailer: git-send-email 2.1.1 +In-Reply-To: +References: +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, 29 Oct 2014 19:30:54 -0000 + +Check the supported combination, and bail out for other combinations. +--- + notmuch-search.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/notmuch-search.c b/notmuch-search.c +index bc9be4593ecc..3bb5a7fbc885 100644 +--- a/notmuch-search.c ++++ b/notmuch-search.c +@@ -387,6 +387,11 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[]) + if (opt_index < 0) + return EXIT_FAILURE; + ++ if (output != OUTPUT_FILES && dupe != -1) { ++ fprintf (stderr, "Error: --duplicate=N is only supported with --output=files.\n"); ++ return EXIT_FAILURE; ++ } ++ + switch (format_sel) { + case NOTMUCH_FORMAT_TEXT: + format = sprinter_text_create (config, stdout); +-- +2.1.1 +