]> git.cworth.org Git - notmuch/commitdiff
notmuch-dump: deprecate use of output file argument.
authorDavid Bremner <bremner@debian.org>
Mon, 10 Oct 2011 13:44:07 +0000 (10:44 -0300)
committerDavid Bremner <bremner@debian.org>
Sun, 16 Oct 2011 22:59:53 +0000 (19:59 -0300)
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
test/dump-restore

index ac5d0742e0f9c61d74eca06633e199ee13491f47..409c86ada6dd709461da7b20e7732a3a345a3880 100644 (file)
@@ -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",
index e7edd9b2573df7fc43e8a2565513c341202e4579..de8569387edf3e1253b4a08c29eada49bfbe3b4d 100755 (executable)
@@ -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