summaryrefslogtreecommitdiffstats
path: root/notmuch.c
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2021-02-25 08:00:26 -0400
committerDavid Bremner <david@tethera.net>2021-03-27 09:26:14 -0300
commit77d4b26d3e374afac0012148a8ac0a08158406f1 (patch)
treeec4ad26e8514ab0d3569e0a1271771e823cf6548 /notmuch.c
parentf5d4349921ded021756d6754d347420e68b23111 (diff)
CLI/config: support set/get with split configuration
There are two small code changes. The main one is to retrieve the possibly updated config file name found during the database opening call. The second change is to allow empty config file names, as a (currently broken) way of specifying that configuration should only be taken from the database.
Diffstat (limited to 'notmuch.c')
-rw-r--r--notmuch.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/notmuch.c b/notmuch.c
index bcb4b768..61663908 100644
--- a/notmuch.c
+++ b/notmuch.c
@@ -454,7 +454,7 @@ main (int argc, char *argv[])
int ret = EXIT_SUCCESS;
notmuch_opt_desc_t options[] = {
- { .opt_string = &config_file_name, .name = "config" },
+ { .opt_string = &config_file_name, .name = "config", .allow_empty = TRUE },
{ .opt_inherit = notmuch_shared_options },
{ }
};
@@ -581,6 +581,9 @@ main (int argc, char *argv[])
}
if (command->mode & NOTMUCH_COMMAND_CONFIG_OPEN) {
+ if (! config_file_name)
+ config_file_name = notmuch_config_path (notmuch);
+
config = notmuch_config_open (notmuch, config_file_name, command->mode);
if (! config) {
ret = EXIT_FAILURE;