X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=notmuch.c;h=e5c2aeb383c23fa404e1034308435e2d0129f7ec;hb=d08af93c65310c2d5ec8033040854f8ff4e5550f;hp=dcda0392a0945123f735399f72308c8653a3b1f4;hpb=b3e7e7925efe573b7209cfd055dd881bdd2533ce;p=notmuch diff --git a/notmuch.c b/notmuch.c index dcda0392..e5c2aeb3 100644 --- a/notmuch.c +++ b/notmuch.c @@ -47,13 +47,15 @@ static command_t commands[] = { { NULL, notmuch_command, TRUE, "Notmuch main command." }, { "setup", notmuch_setup_command, TRUE, - "Interactively setup notmuch for first use." }, + "Interactively set up notmuch for first use." }, { "new", notmuch_new_command, FALSE, "Find and import new messages to the notmuch database." }, { "insert", notmuch_insert_command, FALSE, "Add a new message into the maildir and notmuch database." }, { "search", notmuch_search_command, FALSE, "Search for messages matching the given search terms." }, + { "address", notmuch_address_command, FALSE, + "Get addresses from messages matching the given search terms." }, { "show", notmuch_show_command, FALSE, "Show all messages matching the search terms." }, { "count", notmuch_count_command, FALSE, @@ -312,8 +314,16 @@ main (int argc, char *argv[]) goto DONE; } - if (print_help) { - ret = notmuch_help_command (NULL, argc - 1, &argv[1]); + /* 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 + * argv[0] passed to it. + */ + ret = notmuch_help_command (NULL, argc - opt_index + 1, + argv + opt_index - 1); goto DONE; }