diff options
| author | Jani Nikula <jani@nikula.org> | 2015-03-08 18:18:55 +0200 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2015-03-11 08:07:55 +0100 |
| commit | 2447f4c1192ac6a90fbddcce40008efb0b4a0ee6 (patch) | |
| tree | 6c409c370fe92fed84db8f42edcdaab099f9b8d4 | |
| parent | c17e4fe62988edfe99af804c3d6321353d755e7f (diff) | |
cli: add support for notmuch command --help
Recognize 'notmuch command --help' at the top level as a special case,
and show help for the command. Note that for simplicity, --help is
only recognized as the first option for the subcommand.
| -rw-r--r-- | notmuch.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -314,7 +314,9 @@ main (int argc, char *argv[]) goto DONE; } - if (print_help) { + /* Handle notmuch --help [command] and notmuch command --help. */ + if (print_help || + (opt_index + 1 < argc && strcmp (argv[opt_index + 1], "--help") == 0)) { /* * Pass the first positional argument as argv[1] so the help * command can give help for it. The help command ignores the |
