From: Jani Nikula Date: Sun, 3 Nov 2013 12:24:48 +0000 (+0200) Subject: cli: return error status if compaction fails X-Git-Tag: 0.17_rc1~74 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=d34be29a41bbe1d5bd2c81d7d791cd67ac4eb649 cli: return error status if compaction fails As is customary for any tool. --- diff --git a/notmuch-compact.c b/notmuch-compact.c index 55dc7316..b9461c2f 100644 --- a/notmuch-compact.c +++ b/notmuch-compact.c @@ -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; }