From 3d39d346d793b9bea0c23ae2c16600feab11ee19 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Wed, 3 Sep 2014 11:28:34 -0400 Subject: cli: Be more helpful when .notmuch-config does not exist Previously, if the user ran any subcommand that required a configuration (e.g., notmuch new) but didn't have a configuration, notmuch would give the rather un-friendly and un-actionable message Error reading configuration file .notmuch-config: No such file or directory Since this condition is expected for new users, this patch adds specific handling for the file-not-found case to give a message that is friendly and actionable. --- test/T040-setup.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/T040-setup.sh b/test/T040-setup.sh index 124ef1c8..b1972e70 100755 --- a/test/T040-setup.sh +++ b/test/T040-setup.sh @@ -3,6 +3,12 @@ test_description='"notmuch setup"' . ./test-lib.sh +test_begin_subtest "Notmuch new without a config suggests notmuch setup" +output=$(notmuch --config=new-notmuch-config new 2>&1) +test_expect_equal "$output" "\ +Configuration file new-notmuch-config not found. +Try running 'notmuch setup' to create a configuration." + test_begin_subtest "Create a new config interactively" notmuch --config=new-notmuch-config > /dev/null <