aboutsummaryrefslogtreecommitdiff
path: root/notmuch-compact.c
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2020-12-23 23:45:23 -0400
committerDavid Bremner <david@tethera.net>2021-02-06 19:36:06 -0400
commitf118ef3c3db0a01479a505ba85a34879d8e0dede (patch)
tree76f7396cd2fb33e2f0a0f1529b1d96bf144fe6f6 /notmuch-compact.c
parent5232462dcfe77e6af475c9dd1a25513c43af53f3 (diff)
cli/compact: convert to new configuration framework
Switch to the newly created API function notmuch_database_compact_db, which takes the database opened in main().
Diffstat (limited to 'notmuch-compact.c')
-rw-r--r--notmuch-compact.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/notmuch-compact.c b/notmuch-compact.c
index ab2066e1..361583db 100644
--- a/notmuch-compact.c
+++ b/notmuch-compact.c
@@ -27,9 +27,8 @@ status_update_cb (const char *msg, unused (void *closure))
}
int
-notmuch_compact_command (notmuch_config_t *config, unused(notmuch_database_t *notmuch), int argc, char *argv[])
+notmuch_compact_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch, int argc, char *argv[])
{
- const char *path = notmuch_config_get_database_path (config);
const char *backup_path = NULL;
notmuch_status_t ret;
bool quiet = false;
@@ -55,8 +54,8 @@ notmuch_compact_command (notmuch_config_t *config, unused(notmuch_database_t *no
if (! quiet)
printf ("Compacting database...\n");
- ret = notmuch_database_compact (path, backup_path,
- quiet ? NULL : status_update_cb, NULL);
+ ret = notmuch_database_compact_db (notmuch, backup_path,
+ quiet ? NULL : status_update_cb, NULL);
if (ret) {
fprintf (stderr, "Compaction failed: %s\n", notmuch_status_to_string (ret));
return EXIT_FAILURE;