cli: return error status if compaction fails

As is customary for any tool.
This commit is contained in:
Jani Nikula 2013-11-03 14:24:48 +02:00 committed by David Bremner
parent 00d2ac2b41
commit d34be29a41

View file

@ -43,16 +43,17 @@ notmuch_compact_command (notmuch_config_t *config,
ret = notmuch_database_compact (path, backup_path, status_update_cb, NULL); ret = notmuch_database_compact (path, backup_path, status_update_cb, NULL);
if (ret) { if (ret) {
fprintf (stderr, "Compaction failed: %s\n", notmuch_status_to_string(ret)); fprintf (stderr, "Compaction failed: %s\n", notmuch_status_to_string(ret));
} else { 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");
} }
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; return 0;
} }