cli: enable notmuch --help command

This functionality seems to have been undocumented, if it ever
existed. Document it now.
This commit is contained in:
David Bremner 2015-06-15 17:46:44 +02:00
parent 83e9df98a0
commit 653190bf2a
2 changed files with 5 additions and 3 deletions

View 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`` ``--version``
Print the installed version of notmuch, and exit. Print the installed version of notmuch, and exit.

View file

@ -381,11 +381,11 @@ main (int argc, char *argv[])
goto DONE; goto DONE;
} }
notmuch_process_shared_options (NULL);
if (opt_index < argc) if (opt_index < argc)
command_name = argv[opt_index]; command_name = argv[opt_index];
notmuch_process_shared_options (command_name);
command = find_command (command_name); command = find_command (command_name);
if (!command) { if (!command) {
fprintf (stderr, "Error: Unknown command '%s' (see \"notmuch help\")\n", fprintf (stderr, "Error: Unknown command '%s' (see \"notmuch help\")\n",