diff options
Diffstat (limited to 'src/buildtool/main/cli.cpp')
-rw-r--r-- | src/buildtool/main/cli.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/buildtool/main/cli.cpp b/src/buildtool/main/cli.cpp index bfb79858..61ef7a09 100644 --- a/src/buildtool/main/cli.cpp +++ b/src/buildtool/main/cli.cpp @@ -225,10 +225,11 @@ auto ParseCommandLineArguments(int argc, char const* const* argv) try { app.parse(argc, argv); } catch (CLI::Error& e) { - std::exit(app.exit(e)); + auto exit_code = app.exit(e); + std::exit(exit_code == 0 ? kExitSuccess : kExitSyntaxError); } catch (std::exception const& ex) { Logger::Log(LogLevel::Error, "Command line parse error: {}", ex.what()); - std::exit(kExitFailure); + std::exit(kExitSyntaxError); } if (*cmd_version) { |