]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch.c
notmuch: Add a version (0.1 initially) with a new --version option.
[notmuch] / notmuch.c
index 3b743a903cf78ca4c48f60caef64eba5aee77f20..e519f98e7013b1d0ff3e83cb3b4c730563d8fe3c 100644 (file)
--- a/notmuch.c
+++ b/notmuch.c
@@ -309,6 +309,7 @@ usage (FILE *out)
 
     fprintf (out,
             "Usage: notmuch --help\n"
+            "       notmuch --version\n"
             "       notmuch <command> [args...]\n");
     fprintf (out, "\n");
     fprintf (out, "Where <command> and [args...] are as follows:\n");
@@ -462,6 +463,11 @@ main (int argc, char *argv[])
     if (STRNCMP_LITERAL (argv[1], "--help") == 0)
        return notmuch_help_command (NULL, 0, NULL);
 
+    if (STRNCMP_LITERAL (argv[1], "--version") == 0) {
+       printf ("notmuch version " STRINGIFY(NOTMUCH_VERSION) "\n");
+       return 0;
+    }
+
     for (i = 0; i < ARRAY_SIZE (commands); i++) {
        command = &commands[i];