]> git.notmuchmail.org Git - notmuch/commitdiff
notmuch-dump: remove deprecated positional argument for output file
authorDavid Bremner <bremner@debian.org>
Sat, 4 Aug 2012 02:23:11 +0000 (23:23 -0300)
committerDavid Bremner <bremner@debian.org>
Mon, 6 Aug 2012 11:52:33 +0000 (08:52 -0300)
The syntax --output=filename is a smaller change than deleting the
output argument completely, and conceivably useful e.g. when running
notmuch under a debugger.

man/man1/notmuch-dump.1
notmuch-dump.c
test/dump-restore
test/maildir-sync

index 64abf01467c88ccc8dab7277ebed97c839b009dd..5d1e197258acf60a1a4a9125c87b7035011075ec 100644 (file)
@@ -5,15 +5,14 @@ notmuch-dump \- creates a plain-text dump of the tags of each message
 .SH SYNOPSIS
 
 .B "notmuch dump"
-.RI "[ <" filename "> ] [--]"
+.RI "[ --output=<" filename "> ] [--]"
 .RI "[ <" search-term ">...]"
 
 .SH DESCRIPTION
 
 Dump tags for messages matching the given search terms.
 
-Output is to the given filename, if any, or to stdout.  Note that
-using the filename argument is deprecated.
+Output is to the given filename, if any, or to stdout.
 
 These tags are the only data in the notmuch database that can't be
 recreated from the messages themselves.  The output of notmuch dump is
index 37432142761216e4a87494c3ac57bf79ad207c99..d8186fbc7c297495b77a39c1314f973af151a206 100644 (file)
@@ -44,7 +44,7 @@ notmuch_dump_command (unused (void *ctx), int argc, char *argv[])
     int opt_index;
 
     notmuch_opt_desc_t options[] = {
-       { NOTMUCH_OPT_POSITION, &output_file_name, 0, 0, 0  },
+       { NOTMUCH_OPT_STRING, &output_file_name, "output", 'o', 0  },
        { 0, 0, 0, 0, 0 }
     };
 
@@ -56,7 +56,6 @@ notmuch_dump_command (unused (void *ctx), int argc, char *argv[])
     }
 
     if (output_file_name) {
-       fprintf (stderr, "Warning: the output file argument of dump is deprecated.\n");
        output = fopen (output_file_name, "w");
        if (output == NULL) {
            fprintf (stderr, "Error opening %s for writing: %s\n",
index 439e99808af5721c0042e4e9b7ede85cb0b9170a..c7801cfc000d9c723e7a07f115be22eb5e9cd226 100755 (executable)
@@ -53,16 +53,12 @@ test_expect_success 'Restore with nothing to do, III' \
 test_expect_success 'Invalid restore invocation' \
   'test_must_fail notmuch restore dump.expected another_one'
 
-test_begin_subtest "dump outfile"
-notmuch dump dump-outfile.actual
+test_begin_subtest "dump --output=outfile"
+notmuch dump --output=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_begin_subtest "dump --output=outfile --"
+notmuch dump --output=dump-1-arg-dash.actual --
 test_expect_equal_file dump.expected dump-1-arg-dash.actual
 
 # Note, we assume all messages from cworth have a message-id
@@ -74,12 +70,12 @@ test_begin_subtest "dump -- from:cworth"
 notmuch dump -- from:cworth > dump-dash-cworth.actual
 test_expect_equal_file dump-cworth.expected dump-dash-cworth.actual
 
-test_begin_subtest "dump outfile from:cworth"
-notmuch dump dump-outfile-cworth.actual from:cworth
+test_begin_subtest "dump --output=outfile from:cworth"
+notmuch dump --output=dump-outfile-cworth.actual from:cworth
 test_expect_equal_file dump-cworth.expected dump-outfile-cworth.actual
 
-test_begin_subtest "dump outfile -- from:cworth"
-notmuch dump dump-outfile-dash-inbox.actual -- from:cworth
+test_begin_subtest "dump --output=outfile -- from:cworth"
+notmuch dump --output=dump-outfile-dash-inbox.actual -- from:cworth
 test_expect_equal_file dump-cworth.expected dump-outfile-dash-inbox.actual
 
 test_done
index cd7d2418384dd3a9258b8a717e9f8daeb5cfaa14..0914fa526116c629f0b8cff25a4406da04771d7f 100755 (executable)
@@ -124,7 +124,7 @@ mv $MAIL_DIR/cur/adding-replied-tag:2,RS $MAIL_DIR/cur/adding-replied-tag:2,S
 mv $MAIL_DIR/cur/adding-s-flag:2,S $MAIL_DIR/cur/adding-s-flag:2,
 mv $MAIL_DIR/cur/adding-with-s-flag:2,S $MAIL_DIR/cur/adding-with-s-flag:2,RS
 mv $MAIL_DIR/cur/message-to-move-to-cur:2,S $MAIL_DIR/cur/message-to-move-to-cur:2,DS
-notmuch dump dump.txt
+notmuch dump --output=dump.txt
 NOTMUCH_NEW >/dev/null
 notmuch restore dump.txt
 output=$(ls $MAIL_DIR/cur)