X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=notmuch-setup.c;h=567e3b565359b64018573044828a24d18eb46328;hb=1c747a501c0ed7df5eaa2b994b9ad11d8981c62c;hp=e9b81be839a0736a8b30cb24f88a55d1bbf95311;hpb=34f734e26b1202cbfbbd06293962571538188fc4;p=notmuch diff --git a/notmuch-setup.c b/notmuch-setup.c index e9b81be8..567e3b56 100644 --- a/notmuch-setup.c +++ b/notmuch-setup.c @@ -124,14 +124,14 @@ parse_tag_list (void *ctx, char *response) } int -notmuch_setup_command (notmuch_config_t *config, - notmuch_database_t *notmuch, +notmuch_setup_command (notmuch_database_t *notmuch, int argc, char *argv[]) { char *response = NULL; size_t response_size = 0; GPtrArray *other_emails; notmuch_config_values_t *new_tags, *search_exclude_tags, *emails; + notmuch_config_t *config; #define prompt(format, ...) \ do { \ @@ -151,6 +151,11 @@ notmuch_setup_command (notmuch_config_t *config, fprintf (stderr, "Warning: ignoring --uuid=%s\n", notmuch_requested_db_uuid); + config = notmuch_config_open (notmuch, + notmuch_config_path (notmuch), true); + if (! config) + return EXIT_FAILURE; + if (notmuch_config_is_new (config)) welcome_message_pre_setup (); @@ -232,6 +237,9 @@ notmuch_setup_command (notmuch_config_t *config, if (notmuch_config_save (config)) return EXIT_FAILURE; + if (config) + notmuch_config_close (config); + if (notmuch_config_is_new (config)) welcome_message_post_setup ();