]> git.notmuchmail.org Git - notmuch/commitdiff
CLI: exit with error when load_config returns an error.
authorDavid Bremner <david@tethera.net>
Fri, 15 Sep 2023 12:50:02 +0000 (09:50 -0300)
committerDavid Bremner <david@tethera.net>
Sat, 23 Sep 2023 11:26:40 +0000 (08:26 -0300)
For now print a generic error message and exit with error on any
non-success code. Previously the code exited, but with exit code zero,
leading users / scripts to think the command had succeeded.

notmuch.c
test/T030-config.sh

index 37286b8f491af6428c0d22c3222a01f85039a369..69a181319315261408a93d0d44935fe2084ac374 100644 (file)
--- a/notmuch.c
+++ b/notmuch.c
@@ -584,6 +584,8 @@ main (int argc, char *argv[])
        case NOTMUCH_STATUS_SUCCESS:
            break;
        default:
+           fputs ("Error: unable to load config file.\n", stderr);
+           ret = 1;
            goto DONE;
        }
 
index c416e781708af34efe92bbf9901fd8ad8d9b96f1..2d3017dad96b05ddb766c1b0a3505f17d2415ec9 100755 (executable)
@@ -196,7 +196,6 @@ output=$(notmuch config get built_with.nonexistent)
 test_expect_equal "$output" "false"
 
 test_begin_subtest "Bad utf8 reported as error"
-test_subtest_known_broken
 cp initial-config bad-config
 printf '[query]\nq3=from:\xff\n' >>bad-config
 test_expect_code 1 "notmuch --config=./bad-config config list"