]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch.c
cli: change argument parsing convention for subcommands
[notmuch] / notmuch.c
index 640ad8da56d2a112a79a3a645b03d4dce91d18f7..4232bee7c4e97a93b9ccb81fbc4500c8b3cbbd53 100644 (file)
--- a/notmuch.c
+++ b/notmuch.c
@@ -465,6 +465,8 @@ notmuch_help_command (unused (void *ctx), int argc, char *argv[])
     command_t *command;
     unsigned int i;
 
+    argc--; argv++; /* Ignore "help" */
+
     if (argc == 0) {
        printf ("The notmuch mail system.\n\n");
        usage (stdout);
@@ -639,7 +641,7 @@ main (int argc, char *argv[])
        command = &commands[i];
 
        if (strcmp (argv[1], command->name) == 0)
-           return (command->function) (local, argc - 2, &argv[2]);
+           return (command->function) (local, argc - 1, &argv[1]);
     }
 
     fprintf (stderr, "Error: Unknown command '%s' (see \"notmuch help\")\n",