]> git.notmuchmail.org Git - notmuch/commitdiff
notmuch-restore: replace positional argument for input with option
authorDavid Bremner <bremner@debian.org>
Sat, 4 Aug 2012 12:55:45 +0000 (09:55 -0300)
committerDavid Bremner <bremner@debian.org>
Mon, 6 Aug 2012 11:52:45 +0000 (08:52 -0300)
Since notmuch dump doesn't use positional arguments anymore, it seems
better to be consistent.

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

index 18281c7ea3ae9b5e4e041e1964db5985eb98d543..d0d50dd8df377dbf9963843751e5b9304e7f440d 100644 (file)
@@ -6,7 +6,7 @@ notmuch-restore \- restores the tags from the given file (see notmuch dump)
 
 .B "notmuch restore"
 .RB [ "--accumulate" ]
 
 .B "notmuch restore"
 .RB [ "--accumulate" ]
-.RI "[ <" filename "> ]"
+.RI "[ --input=<" filename "> ]"
 
 .SH DESCRIPTION
 
 
 .SH DESCRIPTION
 
index 4f4096ed15c79b11d06b97abfaa0be0b8fc2af5c..08d5adcbe42271a1660bb56079c488052b5ab520 100644 (file)
@@ -122,7 +122,7 @@ notmuch_restore_command (unused (void *ctx), int argc, char *argv[])
     synchronize_flags = notmuch_config_get_maildir_synchronize_flags (config);
 
     notmuch_opt_desc_t options[] = {
     synchronize_flags = notmuch_config_get_maildir_synchronize_flags (config);
 
     notmuch_opt_desc_t options[] = {
-       { NOTMUCH_OPT_POSITION, &input_file_name, 0, 0, 0 },
+       { NOTMUCH_OPT_STRING, &input_file_name, "input", 'i', 0 },
        { NOTMUCH_OPT_BOOLEAN,  &accumulate, "accumulate", 'a', 0 },
        { 0, 0, 0, 0, 0 }
     };
        { NOTMUCH_OPT_BOOLEAN,  &accumulate, "accumulate", 'a', 0 },
        { 0, 0, 0, 0, 0 }
     };
index c7801cfc000d9c723e7a07f115be22eb5e9cd226..f25f7cf9cabf67859e7dfb4aa94db9ee6f759f1f 100755 (executable)
@@ -19,7 +19,7 @@ test_expect_success 'Dumping all tags II' \
 
 test_expect_success 'Clearing all tags' \
   'sed -e "s/(\([^(]*\))$/()/" < dump.expected > clear.expected &&
 
 test_expect_success 'Clearing all tags' \
   'sed -e "s/(\([^(]*\))$/()/" < dump.expected > clear.expected &&
-  notmuch restore clear.expected &&
+  notmuch restore --input=clear.expected &&
   notmuch dump > clear.actual &&
   test_cmp clear.expected clear.actual'
 
   notmuch dump > clear.actual &&
   test_cmp clear.expected clear.actual'
 
@@ -30,7 +30,7 @@ test_expect_success 'Accumulate original tags' \
   test_cmp dump-ABC_DEF.expected dump.actual'
 
 test_expect_success 'Restoring original tags' \
   test_cmp dump-ABC_DEF.expected dump.actual'
 
 test_expect_success 'Restoring original tags' \
-  'notmuch restore dump.expected &&
+  'notmuch restore --input=dump.expected &&
   notmuch dump > dump.actual &&
   test_cmp dump.expected dump.actual'
 
   notmuch dump > dump.actual &&
   test_cmp dump.expected dump.actual'
 
@@ -40,7 +40,7 @@ test_expect_success 'Restore with nothing to do' \
   test_cmp dump.expected dump.actual'
 
 test_expect_success 'Restore with nothing to do, II' \
   test_cmp dump.expected dump.actual'
 
 test_expect_success 'Restore with nothing to do, II' \
-  'notmuch restore --accumulate dump.expected &&
+  'notmuch restore --accumulate --input=dump.expected &&
   notmuch dump > dump.actual &&
   test_cmp dump.expected dump.actual'
 
   notmuch dump > dump.actual &&
   test_cmp dump.expected dump.actual'
 
@@ -51,7 +51,7 @@ test_expect_success 'Restore with nothing to do, III' \
 
 # notmuch restore currently only considers the first argument.
 test_expect_success 'Invalid restore invocation' \
 
 # notmuch restore currently only considers the first argument.
 test_expect_success 'Invalid restore invocation' \
-  'test_must_fail notmuch restore dump.expected another_one'
+  'test_must_fail notmuch restore --input=dump.expected another_one'
 
 test_begin_subtest "dump --output=outfile"
 notmuch dump --output=dump-outfile.actual
 
 test_begin_subtest "dump --output=outfile"
 notmuch dump --output=dump-outfile.actual
index 0914fa526116c629f0b8cff25a4406da04771d7f..0fc742a419bac7aacb69a762399bda4b11c745fd 100755 (executable)
@@ -126,7 +126,7 @@ 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 --output=dump.txt
 NOTMUCH_NEW >/dev/null
 mv $MAIL_DIR/cur/message-to-move-to-cur:2,S $MAIL_DIR/cur/message-to-move-to-cur:2,DS
 notmuch dump --output=dump.txt
 NOTMUCH_NEW >/dev/null
-notmuch restore dump.txt
+notmuch restore --input=dump.txt
 output=$(ls $MAIL_DIR/cur)
 test_expect_equal "$output" "$expected"
 
 output=$(ls $MAIL_DIR/cur)
 test_expect_equal "$output" "$expected"