Override help print message? #798
Unanswered
LoganSutherland
asked this question in
Q&A
Replies: 1 comment
-
The simplest way to do that is clear the help_flap app->set_help_flag(""); then you can create your own option app->add_flag_callback("--help",[](){ <print whatever you want here>; throw CLI::Success;})->trigger_on_parse(); A more complicated flexible way is to customize the formatter /// Set the help formatter
App *formatter(std::shared_ptr<FormatterBase> fmt) {
formatter_ = fmt;
return this;
}
/// Set the help formatter
App *formatter_fn(std::function<std::string(const App *, std::string, AppFormatMode)> fmt) {
formatter_ = std::make_shared<FormatterLambda>(fmt);
return this;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to override the --help/-h message created by CLI with my own print message?
Beta Was this translation helpful? Give feedback.
All reactions