1 Return-Path: <bremner@tethera.net>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id E382D431FAF
\r
6 for <notmuch@notmuchmail.org>; Sat, 4 Aug 2012 05:56:06 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id eeV6mxrShlim for <notmuch@notmuchmail.org>;
\r
16 Sat, 4 Aug 2012 05:56:06 -0700 (PDT)
\r
17 Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238])
\r
18 (using TLSv1 with cipher AES256-SHA (256/256 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 5C8B7431FAE
\r
21 for <notmuch@notmuchmail.org>; Sat, 4 Aug 2012 05:56:06 -0700 (PDT)
\r
22 Received: from fctnnbsc30w-156034089108.dhcp-dynamic.fibreop.nb.bellaliant.net
\r
23 ([156.34.89.108] helo=zancas.localnet)
\r
24 by tesseract.cs.unb.ca with esmtpsa
\r
25 (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72)
\r
26 (envelope-from <bremner@tethera.net>)
\r
27 id 1Sxdti-0005Sw-UF; Sat, 04 Aug 2012 09:56:03 -0300
\r
28 Received: from bremner by zancas.localnet with local (Exim 4.80)
\r
29 (envelope-from <bremner@tethera.net>)
\r
30 id 1Sxdtd-00070c-I3; Sat, 04 Aug 2012 09:55:57 -0300
\r
31 From: David Bremner <david@tethera.net>
\r
32 To: notmuch@notmuchmail.org
\r
33 Subject: [PATCH v2] notmuch-restore: replace positional argument for input
\r
35 Date: Sat, 4 Aug 2012 09:55:45 -0300
\r
36 Message-Id: <1344084945-26825-1-git-send-email-david@tethera.net>
\r
37 X-Mailer: git-send-email 1.7.10.4
\r
38 In-Reply-To: <1344046992-25976-3-git-send-email-david@tethera.net>
\r
39 References: <1344046992-25976-3-git-send-email-david@tethera.net>
\r
41 Cc: David Bremner <bremner@debian.org>
\r
42 X-BeenThere: notmuch@notmuchmail.org
\r
43 X-Mailman-Version: 2.1.13
\r
45 List-Id: "Use and development of the notmuch mail system."
\r
46 <notmuch.notmuchmail.org>
\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
48 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
50 List-Post: <mailto:notmuch@notmuchmail.org>
\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
53 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
54 X-List-Received-Date: Sat, 04 Aug 2012 12:56:07 -0000
\r
56 From: David Bremner <bremner@debian.org>
\r
58 Since notmuch dump doesn't use positional arguments anymore, it seems
\r
59 better to be consistent.
\r
62 dunno how I missed the failing test in maildir-sync
\r
64 man/man1/notmuch-restore.1 | 2 +-
\r
65 notmuch-restore.c | 2 +-
\r
66 test/dump-restore | 8 ++++----
\r
67 test/maildir-sync | 2 +-
\r
68 4 files changed, 7 insertions(+), 7 deletions(-)
\r
70 diff --git a/man/man1/notmuch-restore.1 b/man/man1/notmuch-restore.1
\r
71 index 18281c7..d0d50dd 100644
\r
72 --- a/man/man1/notmuch-restore.1
\r
73 +++ b/man/man1/notmuch-restore.1
\r
74 @@ -6,7 +6,7 @@ notmuch-restore \- restores the tags from the given file (see notmuch dump)
\r
76 .B "notmuch restore"
\r
77 .RB [ "--accumulate" ]
\r
78 -.RI "[ <" filename "> ]"
\r
79 +.RI "[ --input=<" filename "> ]"
\r
83 diff --git a/notmuch-restore.c b/notmuch-restore.c
\r
84 index 4f4096e..08d5adc 100644
\r
85 --- a/notmuch-restore.c
\r
86 +++ b/notmuch-restore.c
\r
87 @@ -122,7 +122,7 @@ notmuch_restore_command (unused (void *ctx), int argc, char *argv[])
\r
88 synchronize_flags = notmuch_config_get_maildir_synchronize_flags (config);
\r
90 notmuch_opt_desc_t options[] = {
\r
91 - { NOTMUCH_OPT_POSITION, &input_file_name, 0, 0, 0 },
\r
92 + { NOTMUCH_OPT_STRING, &input_file_name, "input", 'i', 0 },
\r
93 { NOTMUCH_OPT_BOOLEAN, &accumulate, "accumulate", 'a', 0 },
\r
96 diff --git a/test/dump-restore b/test/dump-restore
\r
97 index c7801cf..f25f7cf 100755
\r
98 --- a/test/dump-restore
\r
99 +++ b/test/dump-restore
\r
100 @@ -19,7 +19,7 @@ test_expect_success 'Dumping all tags II' \
\r
102 test_expect_success 'Clearing all tags' \
\r
103 'sed -e "s/(\([^(]*\))$/()/" < dump.expected > clear.expected &&
\r
104 - notmuch restore clear.expected &&
\r
105 + notmuch restore --input=clear.expected &&
\r
106 notmuch dump > clear.actual &&
\r
107 test_cmp clear.expected clear.actual'
\r
109 @@ -30,7 +30,7 @@ test_expect_success 'Accumulate original tags' \
\r
110 test_cmp dump-ABC_DEF.expected dump.actual'
\r
112 test_expect_success 'Restoring original tags' \
\r
113 - 'notmuch restore dump.expected &&
\r
114 + 'notmuch restore --input=dump.expected &&
\r
115 notmuch dump > dump.actual &&
\r
116 test_cmp dump.expected dump.actual'
\r
118 @@ -40,7 +40,7 @@ test_expect_success 'Restore with nothing to do' \
\r
119 test_cmp dump.expected dump.actual'
\r
121 test_expect_success 'Restore with nothing to do, II' \
\r
122 - 'notmuch restore --accumulate dump.expected &&
\r
123 + 'notmuch restore --accumulate --input=dump.expected &&
\r
124 notmuch dump > dump.actual &&
\r
125 test_cmp dump.expected dump.actual'
\r
127 @@ -51,7 +51,7 @@ test_expect_success 'Restore with nothing to do, III' \
\r
129 # notmuch restore currently only considers the first argument.
\r
130 test_expect_success 'Invalid restore invocation' \
\r
131 - 'test_must_fail notmuch restore dump.expected another_one'
\r
132 + 'test_must_fail notmuch restore --input=dump.expected another_one'
\r
134 test_begin_subtest "dump --output=outfile"
\r
135 notmuch dump --output=dump-outfile.actual
\r
136 diff --git a/test/maildir-sync b/test/maildir-sync
\r
137 index 0914fa5..0fc742a 100755
\r
138 --- a/test/maildir-sync
\r
139 +++ b/test/maildir-sync
\r
140 @@ -126,7 +126,7 @@ mv $MAIL_DIR/cur/adding-with-s-flag:2,S $MAIL_DIR/cur/adding-with-s-flag:2,RS
\r
141 mv $MAIL_DIR/cur/message-to-move-to-cur:2,S $MAIL_DIR/cur/message-to-move-to-cur:2,DS
\r
142 notmuch dump --output=dump.txt
\r
143 NOTMUCH_NEW >/dev/null
\r
144 -notmuch restore dump.txt
\r
145 +notmuch restore --input=dump.txt
\r
146 output=$(ls $MAIL_DIR/cur)
\r
147 test_expect_equal "$output" "$expected"
\r