From: David Bremner Date: Mon, 15 Jun 2015 15:46:44 +0000 (+0200) Subject: cli: enable notmuch --help command X-Git-Tag: 0.21_rc0~82 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=653190bf2a1bed19e9a8dffc437084604261cc26;ds=sidebyside cli: enable notmuch --help command This functionality seems to have been undocumented, if it ever existed. Document it now. --- diff --git a/doc/man1/notmuch.rst b/doc/man1/notmuch.rst index d773369e..0401c91b 100644 --- a/doc/man1/notmuch.rst +++ b/doc/man1/notmuch.rst @@ -39,8 +39,10 @@ OPTIONS Supported global options for ``notmuch`` include - ``--help`` + ``--help`` [command-name] 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. diff --git a/notmuch.c b/notmuch.c index c528dce2..9580c3fe 100644 --- a/notmuch.c +++ b/notmuch.c @@ -381,11 +381,11 @@ main (int argc, char *argv[]) goto DONE; } - notmuch_process_shared_options (NULL); - 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",