summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/other_tools/just_mr/main.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/other_tools/just_mr/main.cpp b/src/other_tools/just_mr/main.cpp
index 31f63d3d..d27cb3a5 100644
--- a/src/other_tools/just_mr/main.cpp
+++ b/src/other_tools/just_mr/main.cpp
@@ -132,8 +132,11 @@ void SetupSetupCommandArguments(
try {
app.parse(argc, argv);
} catch (CLI::Error& e) {
- [[maybe_unused]] auto err = app.exit(e);
- std::exit(kExitClargsError);
+ // CLI11 throws for things like --help calls for them to be handled
+ // separately by parse callers. In this case it nevertheless sets the
+ // error code to 0 (success).
+ auto const err = app.exit(e);
+ std::exit(err == 0 ? kExitSuccess : kExitClargsError);
} catch (std::exception const& ex) {
Logger::Log(LogLevel::Error, "Command line parse error: {}", ex.what());
std::exit(kExitClargsError);