[PATCH] cli: enable notmuch --help command
authorDavid Bremner <david@tethera.net>
Mon, 15 Jun 2015 15:46:44 +0000 (17:46 +0200)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:49:04 +0000 (14:49 -0700)
14/7b94ea74eb98fad8e896b8b80a94aaf91e7302 [new file with mode: 0644]

diff --git a/14/7b94ea74eb98fad8e896b8b80a94aaf91e7302 b/14/7b94ea74eb98fad8e896b8b80a94aaf91e7302
new file mode 100644 (file)
index 0000000..d9b496f
--- /dev/null
@@ -0,0 +1,89 @@
+Return-Path: <bremner@tesseract.cs.unb.ca>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 0D3B46DE0B36\r
+ for <notmuch@notmuchmail.org>; Mon, 15 Jun 2015 08:47:52 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.191\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.191 tagged_above=-999 required=5 tests=[AWL=0.181, \r
+ T_HEADER_FROM_DIFFERENT_DOMAINS=0.01] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id 0MzBInF0e3w1 for <notmuch@notmuchmail.org>;\r
+ Mon, 15 Jun 2015 08:47:49 -0700 (PDT)\r
+Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net\r
+ [87.98.215.224])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 8C29D6DE0924\r
+ for <notmuch@notmuchmail.org>; Mon, 15 Jun 2015 08:47:49 -0700 (PDT)\r
+Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim\r
+ 4.80) (envelope-from <bremner@tesseract.cs.unb.ca>)\r
+ id 1Z4WbJ-0003P0-So; Mon, 15 Jun 2015 15:47:05 +0000\r
+Received: (nullmailer pid 17207 invoked by uid 1000); Mon, 15 Jun 2015\r
+ 15:46:52 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] cli: enable notmuch --help command\r
+Date: Mon, 15 Jun 2015 17:46:44 +0200\r
+Message-Id: <1434383204-17152-1-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 2.1.4\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\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: Mon, 15 Jun 2015 15:47:52 -0000\r
+\r
+This functionality seems to have been undocumented, if it ever\r
+existed. Document it now.\r
+---\r
+ doc/man1/notmuch.rst | 4 +++-\r
+ notmuch.c            | 4 ++--\r
+ 2 files changed, 5 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/doc/man1/notmuch.rst b/doc/man1/notmuch.rst\r
+index ae0461a..87fb7bc 100644\r
+--- a/doc/man1/notmuch.rst\r
++++ b/doc/man1/notmuch.rst\r
+@@ -39,8 +39,10 @@ OPTIONS\r
\r
+ Supported global options for ``notmuch`` include\r
\r
+-    ``--help``\r
++    ``--help`` [command-name]\r
+         Print a synopsis of available commands and exit.\r
++        With an optional command name, show the man page\r
++        for that subcommand.\r
\r
+     ``--version``\r
+         Print the installed version of notmuch, and exit.\r
+diff --git a/notmuch.c b/notmuch.c\r
+index c528dce..9580c3f 100644\r
+--- a/notmuch.c\r
++++ b/notmuch.c\r
+@@ -381,11 +381,11 @@ main (int argc, char *argv[])\r
+       goto DONE;\r
+     }\r
\r
+-    notmuch_process_shared_options (NULL);\r
+-\r
+     if (opt_index < argc)\r
+       command_name = argv[opt_index];\r
\r
++    notmuch_process_shared_options (command_name);\r
++\r
+     command = find_command (command_name);\r
+     if (!command) {\r
+       fprintf (stderr, "Error: Unknown command '%s' (see \"notmuch help\")\n",\r
+-- \r
+2.1.4\r
+\r