From: david Date: Sat, 4 Aug 2012 02:23:12 +0000 (+2100) Subject: [PATCH 2/2] notmuch-restore: replace positional argument for input with option X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=a8da9734490ddeed26947e82de7828d88d1284e0;p=notmuch-archives.git [PATCH 2/2] notmuch-restore: replace positional argument for input with option --- diff --git a/2a/60ed3b6784b41cefb8b20120a8d8dd52f8f4af b/2a/60ed3b6784b41cefb8b20120a8d8dd52f8f4af new file mode 100644 index 000000000..45e1d6d58 --- /dev/null +++ b/2a/60ed3b6784b41cefb8b20120a8d8dd52f8f4af @@ -0,0 +1,134 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 3EB83431FB6 + for ; Fri, 3 Aug 2012 19:23:35 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 8k2MDS4qzMdj for ; + Fri, 3 Aug 2012 19:23:34 -0700 (PDT) +Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238]) + (using TLSv1 with cipher AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 5DA57431FC7 + for ; Fri, 3 Aug 2012 19:23:34 -0700 (PDT) +Received: from fctnnbsc30w-156034089108.dhcp-dynamic.fibreop.nb.bellaliant.net + ([156.34.89.108] helo=zancas.localnet) + by tesseract.cs.unb.ca with esmtpsa + (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) + (envelope-from ) + id 1SxU1d-0005CC-Kv; Fri, 03 Aug 2012 23:23:33 -0300 +Received: from bremner by zancas.localnet with local (Exim 4.80) + (envelope-from ) + id 1SxU1Y-0006mc-9G; Fri, 03 Aug 2012 23:23:28 -0300 +From: david@tethera.net +To: notmuch@notmuchmail.org +Subject: [PATCH 2/2] notmuch-restore: replace positional argument for input + with option +Date: Fri, 3 Aug 2012 23:23:12 -0300 +Message-Id: <1344046992-25976-3-git-send-email-david@tethera.net> +X-Mailer: git-send-email 1.7.10.4 +In-Reply-To: <1344046992-25976-1-git-send-email-david@tethera.net> +References: <1344046992-25976-1-git-send-email-david@tethera.net> +X-Spam_bar: - +Cc: David Bremner +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 04 Aug 2012 02:23:35 -0000 + +From: David Bremner + +Since notmuch dump doesn't use positional arguments anymore, it seems +better to be consistent. +--- + man/man1/notmuch-restore.1 | 2 +- + notmuch-restore.c | 2 +- + test/dump-restore | 8 ++++---- + 3 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/man/man1/notmuch-restore.1 b/man/man1/notmuch-restore.1 +index 18281c7..d0d50dd 100644 +--- a/man/man1/notmuch-restore.1 ++++ b/man/man1/notmuch-restore.1 +@@ -6,7 +6,7 @@ notmuch-restore \- restores the tags from the given file (see notmuch dump) + + .B "notmuch restore" + .RB [ "--accumulate" ] +-.RI "[ <" filename "> ]" ++.RI "[ --input=<" filename "> ]" + + .SH DESCRIPTION + +diff --git a/notmuch-restore.c b/notmuch-restore.c +index 4f4096e..08d5adc 100644 +--- a/notmuch-restore.c ++++ b/notmuch-restore.c +@@ -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[] = { +- { 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 } + }; +diff --git a/test/dump-restore b/test/dump-restore +index c7801cf..f25f7cf 100755 +--- a/test/dump-restore ++++ b/test/dump-restore +@@ -19,7 +19,7 @@ test_expect_success 'Dumping all tags II' \ + + 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' + +@@ -30,7 +30,7 @@ test_expect_success 'Accumulate 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' + +@@ -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' \ +- 'notmuch restore --accumulate dump.expected && ++ 'notmuch restore --accumulate --input=dump.expected && + 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' \ +- '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 +-- +1.7.10.4 +