--- /dev/null
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 1D986431FC2\r
+ for <notmuch@notmuchmail.org>; Wed, 29 Oct 2014 12:30:54 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id JlQhLdMvkwth for <notmuch@notmuchmail.org>;\r
+ Wed, 29 Oct 2014 12:30:48 -0700 (PDT)\r
+Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com\r
+ [209.85.212.179]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 6AC63431FB6\r
+ for <notmuch@notmuchmail.org>; Wed, 29 Oct 2014 12:30:48 -0700 (PDT)\r
+Received: by mail-wi0-f179.google.com with SMTP id h11so5530626wiw.6\r
+ for <notmuch@notmuchmail.org>; Wed, 29 Oct 2014 12:30:47 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
+ :references;\r
+ bh=iAAuSExP8hbOWzlE7iHCzhc8CgYzLwBQ/o9sLRpzjNk=;\r
+ b=ZjgFRHo9D71IM+ACir5yv7DcI7wzeFCWLm6fe3KngD5JJTZ8dTzX8WYuJ+JSn/W48g\r
+ CnQAMidPbzzCn0jrVx8e78+zP+N1g8vEhoyXsYppTWuh6zS0e6uXdAzy71YBD75TJd6k\r
+ 3hfV92LwqtZMDocEL+0gp0ClLtdAdQDy/i5HLlzL9wiraDk4s+w8OEBirZmCVuBD6HRI\r
+ UyDoWmo7IMPvnk/xGCXLYP9lXkarKHJk9VrMIZJOgTZnF8LiSqSAP3vFxxDPbqT/uPB6\r
+ 0kW3DE44fnIvPFYYYWtd3PhXKPESidRYEzqlM2uGgp5Xq6ay2UEuK9NYGywAWl07XydK\r
+ mfew==\r
+X-Gm-Message-State:\r
+ ALoCoQkFucPWG3Mb1vqyNz/NRO97Q4SlmVhYpnYZRzYGj3VarPe1Ga3XinH9NeqvuwtkKvPw1Bxy\r
+X-Received: by 10.180.79.169 with SMTP id k9mr15232832wix.34.1414611047032;\r
+ Wed, 29 Oct 2014 12:30:47 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw2-58c36d-48.dhcp.inet.fi.\r
+ [88.195.109.48]) by mx.google.com with ESMTPSA id\r
+ bg10sm6166259wjc.47.2014.10.29.12.30.45 for <multiple recipients>\r
+ (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Wed, 29 Oct 2014 12:30:46 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org,\r
+ David Edmondson <dme@dme.org>\r
+Subject: [PATCH] cli: notmuch search --duplicate=N is only supported with\r
+ --output=files\r
+Date: Wed, 29 Oct 2014 21:30:43 +0200\r
+Message-Id: <1414611043-3498-1-git-send-email-jani@nikula.org>\r
+X-Mailer: git-send-email 2.1.1\r
+In-Reply-To: <cunr3xqolg8.fsf@gargravarr.hh.sledj.net>\r
+References: <cunr3xqolg8.fsf@gargravarr.hh.sledj.net>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 29 Oct 2014 19:30:54 -0000\r
+\r
+Check the supported combination, and bail out for other combinations.\r
+---\r
+ notmuch-search.c | 5 +++++\r
+ 1 file changed, 5 insertions(+)\r
+\r
+diff --git a/notmuch-search.c b/notmuch-search.c\r
+index bc9be4593ecc..3bb5a7fbc885 100644\r
+--- a/notmuch-search.c\r
++++ b/notmuch-search.c\r
+@@ -387,6 +387,11 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[])\r
+ if (opt_index < 0)\r
+ return EXIT_FAILURE;\r
+ \r
++ if (output != OUTPUT_FILES && dupe != -1) {\r
++ fprintf (stderr, "Error: --duplicate=N is only supported with --output=files.\n");\r
++ return EXIT_FAILURE;\r
++ }\r
++\r
+ switch (format_sel) {\r
+ case NOTMUCH_FORMAT_TEXT:\r
+ format = sprinter_text_create (config, stdout);\r
+-- \r
+2.1.1\r
+\r