[PATCH 1/2] notmuch-dump: remove deprecated positional argument for output file
authordavid <david@tethera.net>
Sat, 4 Aug 2012 02:23:11 +0000 (23:23 +2100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:48:49 +0000 (09:48 -0800)
df/bdb0839bc51b3711bd89269fad275098215468 [new file with mode: 0644]

diff --git a/df/bdb0839bc51b3711bd89269fad275098215468 b/df/bdb0839bc51b3711bd89269fad275098215468
new file mode 100644 (file)
index 0000000..df53230
--- /dev/null
@@ -0,0 +1,168 @@
+Return-Path: <bremner@tethera.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 92325431FD2\r
+       for <notmuch@notmuchmail.org>; Fri,  3 Aug 2012 19:23:32 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id d6a-B4nmGPb3 for <notmuch@notmuchmail.org>;\r
+       Fri,  3 Aug 2012 19:23:30 -0700 (PDT)\r
+Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238])\r
+       (using TLSv1 with cipher AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 2E923431FC7\r
+       for <notmuch@notmuchmail.org>; Fri,  3 Aug 2012 19:23:28 -0700 (PDT)\r
+Received: from fctnnbsc30w-156034089108.dhcp-dynamic.fibreop.nb.bellaliant.net\r
+       ([156.34.89.108] helo=zancas.localnet)\r
+       by tesseract.cs.unb.ca with esmtpsa\r
+       (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72)\r
+       (envelope-from <bremner@tethera.net>)\r
+       id 1SxU1X-0005C7-65; Fri, 03 Aug 2012 23:23:27 -0300\r
+Received: from bremner by zancas.localnet with local (Exim 4.80)\r
+       (envelope-from <bremner@tethera.net>)\r
+       id 1SxU1R-0006mS-Mg; Fri, 03 Aug 2012 23:23:21 -0300\r
+From: david@tethera.net\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/2] notmuch-dump: remove deprecated positional argument for\r
+       output file\r
+Date: Fri,  3 Aug 2012 23:23:11 -0300\r
+Message-Id: <1344046992-25976-2-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <1344046992-25976-1-git-send-email-david@tethera.net>\r
+References: <1344046992-25976-1-git-send-email-david@tethera.net>\r
+X-Spam_bar: -\r
+Cc: David Bremner <bremner@debian.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 04 Aug 2012 02:23:32 -0000\r
+\r
+From: David Bremner <bremner@debian.org>\r
+\r
+The syntax --output=filename is a smaller change than deleting the\r
+output argument completely, and conceivably useful e.g. when running\r
+notmuch under a debugger.\r
+---\r
+ man/man1/notmuch-dump.1 |    5 ++---\r
+ notmuch-dump.c          |    3 +--\r
+ test/dump-restore       |   20 ++++++++------------\r
+ test/maildir-sync       |    2 +-\r
+ 4 files changed, 12 insertions(+), 18 deletions(-)\r
+\r
+diff --git a/man/man1/notmuch-dump.1 b/man/man1/notmuch-dump.1\r
+index 64abf01..5d1e197 100644\r
+--- a/man/man1/notmuch-dump.1\r
++++ b/man/man1/notmuch-dump.1\r
+@@ -5,15 +5,14 @@ notmuch-dump \- creates a plain-text dump of the tags of each message\r
+ .SH SYNOPSIS\r
+ \r
+ .B "notmuch dump"\r
+-.RI "[ <" filename "> ] [--]"\r
++.RI "[ --output=<" filename "> ] [--]"\r
+ .RI "[ <" search-term ">...]"\r
+ \r
+ .SH DESCRIPTION\r
+ \r
+ Dump tags for messages matching the given search terms.\r
+ \r
+-Output is to the given filename, if any, or to stdout.  Note that\r
+-using the filename argument is deprecated.\r
++Output is to the given filename, if any, or to stdout.\r
+ \r
+ These tags are the only data in the notmuch database that can't be\r
+ recreated from the messages themselves.  The output of notmuch dump is\r
+diff --git a/notmuch-dump.c b/notmuch-dump.c\r
+index 3743214..d8186fb 100644\r
+--- a/notmuch-dump.c\r
++++ b/notmuch-dump.c\r
+@@ -44,7 +44,7 @@ notmuch_dump_command (unused (void *ctx), int argc, char *argv[])\r
+     int opt_index;\r
+ \r
+     notmuch_opt_desc_t options[] = {\r
+-      { NOTMUCH_OPT_POSITION, &output_file_name, 0, 0, 0  },\r
++      { NOTMUCH_OPT_STRING, &output_file_name, "output", 'o', 0  },\r
+       { 0, 0, 0, 0, 0 }\r
+     };\r
+ \r
+@@ -56,7 +56,6 @@ notmuch_dump_command (unused (void *ctx), int argc, char *argv[])\r
+     }\r
+ \r
+     if (output_file_name) {\r
+-      fprintf (stderr, "Warning: the output file argument of dump is deprecated.\n");\r
+       output = fopen (output_file_name, "w");\r
+       if (output == NULL) {\r
+           fprintf (stderr, "Error opening %s for writing: %s\n",\r
+diff --git a/test/dump-restore b/test/dump-restore\r
+index 439e998..c7801cf 100755\r
+--- a/test/dump-restore\r
++++ b/test/dump-restore\r
+@@ -53,16 +53,12 @@ test_expect_success 'Restore with nothing to do, III' \\r
+ test_expect_success 'Invalid restore invocation' \\r
+   'test_must_fail notmuch restore dump.expected another_one'\r
+ \r
+-test_begin_subtest "dump outfile"\r
+-notmuch dump dump-outfile.actual\r
++test_begin_subtest "dump --output=outfile"\r
++notmuch dump --output=dump-outfile.actual\r
+ test_expect_equal_file dump.expected dump-outfile.actual\r
+ \r
+-test_begin_subtest "dump outfile # deprecated"\r
+-test_expect_equal "Warning: the output file argument of dump is deprecated."\\r
+-  "$(notmuch dump /dev/null 2>&1)"\r
+-\r
+-test_begin_subtest "dump outfile --"\r
+-notmuch dump dump-1-arg-dash.actual --\r
++test_begin_subtest "dump --output=outfile --"\r
++notmuch dump --output=dump-1-arg-dash.actual --\r
+ test_expect_equal_file dump.expected dump-1-arg-dash.actual\r
+ \r
+ # Note, we assume all messages from cworth have a message-id\r
+@@ -74,12 +70,12 @@ test_begin_subtest "dump -- from:cworth"\r
+ notmuch dump -- from:cworth > dump-dash-cworth.actual\r
+ test_expect_equal_file dump-cworth.expected dump-dash-cworth.actual\r
+ \r
+-test_begin_subtest "dump outfile from:cworth"\r
+-notmuch dump dump-outfile-cworth.actual from:cworth\r
++test_begin_subtest "dump --output=outfile from:cworth"\r
++notmuch dump --output=dump-outfile-cworth.actual from:cworth\r
+ test_expect_equal_file dump-cworth.expected dump-outfile-cworth.actual\r
+ \r
+-test_begin_subtest "dump outfile -- from:cworth"\r
+-notmuch dump dump-outfile-dash-inbox.actual -- from:cworth\r
++test_begin_subtest "dump --output=outfile -- from:cworth"\r
++notmuch dump --output=dump-outfile-dash-inbox.actual -- from:cworth\r
+ test_expect_equal_file dump-cworth.expected dump-outfile-dash-inbox.actual\r
+ \r
+ test_done\r
+diff --git a/test/maildir-sync b/test/maildir-sync\r
+index cd7d241..0914fa5 100755\r
+--- a/test/maildir-sync\r
++++ b/test/maildir-sync\r
+@@ -124,7 +124,7 @@ mv $MAIL_DIR/cur/adding-replied-tag:2,RS $MAIL_DIR/cur/adding-replied-tag:2,S\r
+ mv $MAIL_DIR/cur/adding-s-flag:2,S $MAIL_DIR/cur/adding-s-flag:2,\r
+ mv $MAIL_DIR/cur/adding-with-s-flag:2,S $MAIL_DIR/cur/adding-with-s-flag:2,RS\r
+ mv $MAIL_DIR/cur/message-to-move-to-cur:2,S $MAIL_DIR/cur/message-to-move-to-cur:2,DS\r
+-notmuch dump dump.txt\r
++notmuch dump --output=dump.txt\r
+ NOTMUCH_NEW >/dev/null\r
+ notmuch restore dump.txt\r
+ output=$(ls $MAIL_DIR/cur)\r
+-- \r
+1.7.10.4\r
+\r