]> git.notmuchmail.org Git - notmuch/commitdiff
cli: enable notmuch --help command
authorDavid Bremner <david@tethera.net>
Mon, 15 Jun 2015 15:46:44 +0000 (17:46 +0200)
committerDavid Bremner <david@tethera.net>
Thu, 30 Jul 2015 05:45:26 +0000 (07:45 +0200)
This functionality seems to have been undocumented, if it ever
existed. Document it now.

doc/man1/notmuch.rst
notmuch.c

index d773369ecb4a82a3dc509d018f9325339568a893..0401c91bea89d3a0381eee37c2d59064ac69ec8c 100644 (file)
@@ -39,8 +39,10 @@ OPTIONS
 
 Supported global options for ``notmuch`` include
 
 
 Supported global options for ``notmuch`` include
 
-    ``--help``
+    ``--help`` [command-name]
        Print a synopsis of available commands and exit.
        Print a synopsis of available commands and exit.
+       With an optional command name, show the man page
+       for that subcommand.
 
     ``--version``
        Print the installed version of notmuch, and exit.
 
     ``--version``
        Print the installed version of notmuch, and exit.
index c528dce2d12100b66d9dffd00093faefd33f5965..9580c3fe1e062b4821b8bd10677aafbd8f5ddc5c 100644 (file)
--- a/notmuch.c
+++ b/notmuch.c
@@ -381,11 +381,11 @@ main (int argc, char *argv[])
        goto DONE;
     }
 
        goto DONE;
     }
 
-    notmuch_process_shared_options (NULL);
-
     if (opt_index < argc)
        command_name = argv[opt_index];
 
     if (opt_index < argc)
        command_name = argv[opt_index];
 
+    notmuch_process_shared_options (command_name);
+
     command = find_command (command_name);
     if (!command) {
        fprintf (stderr, "Error: Unknown command '%s' (see \"notmuch help\")\n",
     command = find_command (command_name);
     if (!command) {
        fprintf (stderr, "Error: Unknown command '%s' (see \"notmuch help\")\n",