mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-05-05 06:33:52 +00:00
Add REQUIRED to an app-name in case it is listed in the subcommand list of another app. (#860)
This commit is contained in:
parent
18a256ec85
commit
eb4913d53e
@ -69,7 +69,7 @@ CLI11_INLINE std::string Formatter::make_description(const App *app) const {
|
|||||||
auto min_options = app->get_require_option_min();
|
auto min_options = app->get_require_option_min();
|
||||||
auto max_options = app->get_require_option_max();
|
auto max_options = app->get_require_option_max();
|
||||||
if(app->get_required()) {
|
if(app->get_required()) {
|
||||||
desc += " REQUIRED ";
|
desc += " " + get_label("REQUIRED") + " ";
|
||||||
}
|
}
|
||||||
if((max_options == min_options) && (min_options > 0)) {
|
if((max_options == min_options) && (min_options > 0)) {
|
||||||
if(min_options == 1) {
|
if(min_options == 1) {
|
||||||
@ -213,7 +213,10 @@ CLI11_INLINE std::string Formatter::make_subcommands(const App *app, AppFormatMo
|
|||||||
|
|
||||||
CLI11_INLINE std::string Formatter::make_subcommand(const App *sub) const {
|
CLI11_INLINE std::string Formatter::make_subcommand(const App *sub) const {
|
||||||
std::stringstream out;
|
std::stringstream out;
|
||||||
detail::format_help(out, sub->get_display_name(true), sub->get_description(), column_width_);
|
detail::format_help(out,
|
||||||
|
sub->get_display_name(true) + (sub->get_required() ? " " + get_label("REQUIRED") : ""),
|
||||||
|
sub->get_description(),
|
||||||
|
column_width_);
|
||||||
return out.str();
|
return out.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user