Skip to content

Commit

Permalink
core/app_template: return status code 0 for --help
Browse files Browse the repository at this point in the history
if user queries the usage of an seastar application using
`--help`, `--help-seastar` or `--help-loggers`, he/she should not
be greeted with a non-zero status code, which implies an error
in general. but in this case, there is no errors. so we should
return 0 as the status code.

Signed-off-by: Kefu Chai <[email protected]>

Closes scylladb#2213
  • Loading branch information
tchaikov authored and xemul committed May 2, 2024
1 parent 80f8065 commit b8a13be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/app-template.cc
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,15 @@ app_template::run_deprecated(int ac, char ** av, std::function<void ()>&& func)
std::cout << _opts.description << "\n";
}
std::cout << _app_opts << "\n";
return 1;
return 0;
}
if (configuration.count("help-seastar")) {
std::cout << _seastar_opts << "\n";
return 1;
return 0;
}
if (configuration.count("help-loggers")) {
log_cli::print_available_loggers(std::cout);
return 1;
return 0;
}

try {
Expand Down

0 comments on commit b8a13be

Please sign in to comment.