]> git.notmuchmail.org Git - notmuch/commitdiff
cli: return error status if compaction fails
authorJani Nikula <jani@nikula.org>
Sun, 3 Nov 2013 12:24:48 +0000 (14:24 +0200)
committerDavid Bremner <david@tethera.net>
Thu, 7 Nov 2013 10:54:53 +0000 (06:54 -0400)
As is customary for any tool.

notmuch-compact.c

index 55dc7316ccb810d7a90542f45adab60347e58c8b..b9461c2fcae641922811173cef59574a65b0f95b 100644 (file)
@@ -43,16 +43,17 @@ notmuch_compact_command (notmuch_config_t *config,
     ret = notmuch_database_compact (path, backup_path, status_update_cb, NULL);
     if (ret) {
        fprintf (stderr, "Compaction failed: %s\n", notmuch_status_to_string(ret));
-    } else {
-       printf ("\n");
-       printf ("\n");
-       printf ("The old database has been moved to %s", backup_path);
-       printf ("\n");
-       printf ("To delete run,\n");
-       printf ("\n");
-       printf ("    rm -R %s\n", backup_path);
-       printf ("\n");
+       return 1;
     }
 
+    printf ("\n");
+    printf ("\n");
+    printf ("The old database has been moved to %s", backup_path);
+    printf ("\n");
+    printf ("To delete run,\n");
+    printf ("\n");
+    printf ("    rm -R %s\n", backup_path);
+    printf ("\n");
+
     return 0;
 }