]> git.notmuchmail.org Git - notmuch/commitdiff
CLI: update call to notmuch_help_command for new calling conventions.
authorDavid Bremner <bremner@debian.org>
Thu, 24 Nov 2011 20:02:41 +0000 (16:02 -0400)
committerDavid Bremner <bremner@debian.org>
Fri, 25 Nov 2011 17:07:10 +0000 (12:07 -0500)
When I changed the calling convention to pass in all but the zero-th
argument to subcommands, I missed this one call, resulting in a
segmentation fault.

As a bonus, the syntax "notmuch --help foo" is now equivalent to
"notmuch help foo".

notmuch.c

index 77973f80213e0f87c7c45dc088f4257b9ca49115..d44ce9a0da18fced2dd36a474f51d496b85013cf 100644 (file)
--- a/notmuch.c
+++ b/notmuch.c
@@ -621,7 +621,7 @@ main (int argc, char *argv[])
        return notmuch (local);
 
     if (STRNCMP_LITERAL (argv[1], "--help") == 0)
-       return notmuch_help_command (NULL, 0, NULL);
+       return notmuch_help_command (NULL, argc - 1, &argv[1]);
 
     if (STRNCMP_LITERAL (argv[1], "--version") == 0) {
        printf ("notmuch " STRINGIFY(NOTMUCH_VERSION) "\n");