From b4b84f6847b0b25c798a4ce733cdeb1a0df6926b Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Tue, 21 Sep 2021 17:45:18 -0700 Subject: [PATCH] builtin.cpp: don't check exit code if not a normal exit Fixes #8308 --- src/builtin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/builtin.cpp b/src/builtin.cpp index 3cecad83b..80c29895f 100644 --- a/src/builtin.cpp +++ b/src/builtin.cpp @@ -158,7 +158,7 @@ void builtin_print_help(parser_t &parser, const io_streams_t &streams, const wch ios.push_back(std::make_shared(STDOUT_FILENO, STDERR_FILENO)); } auto res = parser.eval(cmd, ios); - if (res.status.exit_code() == 2) { + if (res.status.normal_exited() && res.status.exit_code() == 2) { streams.err.append_format(BUILTIN_ERR_MISSING_HELP, name_esc.c_str(), name_esc.c_str()); } }