[PATCH 6/6] notmuch-dump: deprecate use of output file argument.
From: David Bremner We print an intentionally non-specific message on stderr, since it isn't clear if there will be some global output file argument to replace. We update the test suite atomically, since it relies on having the same text in two files. --- notmuch-dump.c|1 + test/dump-restore |4 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/notmuch-dump.c b/notmuch-dump.c index ac5d074..409c86a 100644 --- a/notmuch-dump.c +++ b/notmuch-dump.c @@ -42,6 +42,7 @@ notmuch_dump_command (unused (void *ctx), int argc, char *argv[]) return 1; if (argc && strcmp (argv[0], "--") != 0) { + fprintf (stderr, "Warning: the output file argument of dump is deprecated.\n"); output = fopen (argv[0], "w"); if (output == NULL) { fprintf (stderr, "Error opening %s for writing: %s\n", diff --git a/test/dump-restore b/test/dump-restore index d8db259..5f3f0db 100755 --- a/test/dump-restore +++ b/test/dump-restore @@ -12,6 +12,10 @@ test_begin_subtest "dump outfile" notmuch dump dump-outfile.actual test_expect_equal_file dump.expected dump-outfile.actual +test_begin_subtest "dump outfile # deprecated" +test_expect_equal "Warning: the output file argument of dump is deprecated."\ + "$(notmuch dump /dev/null 2>&1)" + test_begin_subtest "dump outfile --" notmuch dump dump-1-arg-dash.actual test_expect_equal_file dump.expected dump-1-arg-dash.actual -- 1.7.6.3
[PATCH 6/6] notmuch-dump: deprecate use of output file argument.
From: David Bremner We print an intentionally non-specific message on stderr, since it isn't clear if there will be some global output file argument to replace. We update the test suite atomically, since it relies on having the same text in two files. --- notmuch-dump.c|1 + test/dump-restore |4 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/notmuch-dump.c b/notmuch-dump.c index ac5d074..409c86a 100644 --- a/notmuch-dump.c +++ b/notmuch-dump.c @@ -42,6 +42,7 @@ notmuch_dump_command (unused (void *ctx), int argc, char *argv[]) return 1; if (argc && strcmp (argv[0], "--") != 0) { + fprintf (stderr, "Warning: the output file argument of dump is deprecated.\n"); output = fopen (argv[0], "w"); if (output == NULL) { fprintf (stderr, "Error opening %s for writing: %s\n", diff --git a/test/dump-restore b/test/dump-restore index d8db259..5f3f0db 100755 --- a/test/dump-restore +++ b/test/dump-restore @@ -12,6 +12,10 @@ test_begin_subtest "dump outfile" notmuch dump dump-outfile.actual test_expect_equal_file dump.expected dump-outfile.actual +test_begin_subtest "dump outfile # deprecated" +test_expect_equal "Warning: the output file argument of dump is deprecated."\ + "$(notmuch dump /dev/null 2>&1)" + test_begin_subtest "dump outfile --" notmuch dump dump-1-arg-dash.actual test_expect_equal_file dump.expected dump-1-arg-dash.actual -- 1.7.6.3 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch