Commit 87b23f58 authored by Mathieu Giraud's avatar Mathieu Giraud

lib/CLI11.hpp: CallForAdvancedHelp()

Replays 86e788fc.
parent 7130f076
......@@ -546,6 +546,11 @@ class CallForHelp : public ParseError {
CallForHelp() : CallForHelp("This should be caught in your main function, see examples", ExitCodes::Success) {}
};
class CallForAdvancedHelp : public ParseError {
CLI11_ERROR_DEF(ParseError, CallForAdvancedHelp)
CallForAdvancedHelp() : CallForAdvancedHelp("This should be caught in your main function, see examples", ExitCodes::Success /* , 2 */ ) {}
};
/// Does not output a diagnostic in CLI11_PARSE, but allows to return from main() with a specific error code.
class RuntimeError : public ParseError {
CLI11_ERROR_DEF(ParseError, RuntimeError)
......@@ -2502,6 +2507,11 @@ class App {
return e.get_exit_code();
}
if(dynamic_cast<const CLI::CallForAdvancedHelp *>(&e) != nullptr) {
out << help(30, "", 2);
return e.get_exit_code();
}
if(e.get_exit_code() != static_cast<int>(ExitCodes::Success)) {
if(failure_message_)
err << failure_message_(this, e) << std::flush;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment