[PATCH] cli: notmuch search --duplicate=N is only supported with --output=files

Jani Nikula jani at nikula.org
Wed Oct 29 12:30:43 PDT 2014


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



More information about the notmuch mailing list