diff options
author | Jani Nikula <jani@nikula.org> | 2013-03-03 23:55:08 +0200 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2013-03-07 09:39:12 -0400 |
commit | e76f6517de020783d828be59f461f1d4f465c4b4 (patch) | |
tree | 9bc07e087684487f14f05bcb8e88e30452f0d0d1 /notmuch.c | |
parent | ca3a4fc02287f65c3587908012d36e68df0200b1 (diff) |
cli: config: make notmuch_config_open() "is new" parameter input only
We now have a notmuch_config_is_new() function to query whether a
config was created or not. Change the notmuch_config_open() is_new
parameter into boolean create_new to determine whether the function
should create a new config if one doesn't exist. This reduces the
complexity of the API.
Diffstat (limited to 'notmuch.c')
-rw-r--r-- | notmuch.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -202,16 +202,15 @@ static int notmuch_command (void *ctx, unused(int argc), unused(char *argv[])) { notmuch_config_t *config; - notmuch_bool_t is_new; char *db_path; struct stat st; - config = notmuch_config_open (ctx, NULL, &is_new); + config = notmuch_config_open (ctx, NULL, TRUE); /* If the user has never configured notmuch, then run * notmuch_setup_command which will give a nice welcome message, * and interactively guide the user through the configuration. */ - if (is_new) { + if (notmuch_config_is_new (config)) { notmuch_config_close (config); return notmuch_setup_command (ctx, 0, NULL); } |