]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch.c
cli: add support for notmuch command --help
[notmuch] / notmuch.c
index 1717e8b3683c485e4652e37abc9886e13d2afa49..a5b2877aee09243044b960d6b3b1f833fbf091af 100644 (file)
--- a/notmuch.c
+++ b/notmuch.c
@@ -314,7 +314,9 @@ main (int argc, char *argv[])
        goto DONE;
     }
 
        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
        /*
         * Pass the first positional argument as argv[1] so the help
         * command can give help for it. The help command ignores the