From b52df7e730773e8daf81aab5c0070b710d54dd2f Mon Sep 17 00:00:00 2001 From: David Bremner Date: Thu, 25 Feb 2021 08:00:26 -0400 Subject: [PATCH] WIP: set and get config with split configuration --- notmuch.c | 3 +++ test/T055-path-config.sh | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/notmuch.c b/notmuch.c index fa6b7eaa..b73a853c 100644 --- a/notmuch.c +++ b/notmuch.c @@ -565,6 +565,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; diff --git a/test/T055-path-config.sh b/test/T055-path-config.sh index 0a34e67f..4805554b 100755 --- a/test/T055-path-config.sh +++ b/test/T055-path-config.sh @@ -215,7 +215,11 @@ EOF test_expect_equal_file EXPECTED OUTPUT - restore_config + test_begin_subtest "Set config value ($config)" + notmuch config set foo.string "this is a string value" + test_expect_equal "$(notmuch config get foo.string)" "this is a string value" + + restore_config done test_done -- git format-patch -1 --stdout -C b52df7e730773e8daf81aab5c0070b710d54dd2f