]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch.c
notmuch: Move welcome messages from "notmuch" to "notmuch setup".
[notmuch] / notmuch.c
index 224e4a6bfe5d4ea28e1d4477edd6942058940cb0..c9b5c8b989df3a0033acfd4d576d8033a98d86ab 100644 (file)
--- a/notmuch.c
+++ b/notmuch.c
@@ -204,16 +204,30 @@ notmuch_help_command (unused (void *ctx), int argc, char *argv[])
             argv[0]);
     return 1;
 }
-    
+
+/* Handle the case of "notmuch" being invoked with no command
+ * argument. For now we just call notmuch_setup_command, but we plan
+ * to be more clever about this in the future.
+ */
+static int
+notmuch (void *ctx)
+{
+    return notmuch_setup_command (ctx, 0, NULL);
+}
+
 int
 main (int argc, char *argv[])
 {
-    void *local = talloc_new (NULL);
+    void *local;
     command_t *command;
     unsigned int i;
 
+    local = talloc_new (NULL);
+
+    g_mime_init (0);
+
     if (argc == 1)
-       return notmuch_setup_command (local, 0, NULL);
+       return notmuch (local);
 
     for (i = 0; i < ARRAY_SIZE (commands); i++) {
        command = &commands[i];