| 7974 | } |
| 7975 | |
| 7976 | inline std::string Formatter::make_help(const App *app, std::string name, AppFormatMode mode) const { |
| 7977 | // This immediately forwards to the make_expanded method. This is done this way so that subcommands can |
| 7978 | // have overridden formatters |
| 7979 | if (mode == AppFormatMode::Sub) return make_expanded(app); |
| 7980 | |
| 7981 | std::stringstream out; |
| 7982 | if ((app->get_name().empty()) && (app->get_parent() != nullptr)) { |
| 7983 | if (app->get_group() != "Subcommands") { |
| 7984 | out << app->get_group() << ':'; |
| 7985 | } |
| 7986 | } |
| 7987 | |
| 7988 | out << make_description(app); |
| 7989 | out << make_usage(app, name); |
| 7990 | out << make_positionals(app); |
| 7991 | out << make_groups(app, mode); |
| 7992 | out << make_subcommands(app, mode); |
| 7993 | out << '\n' << make_footer(app); |
| 7994 | |
| 7995 | return out.str(); |
| 7996 | } |
| 7997 | |
| 7998 | inline std::string Formatter::make_subcommands(const App *app, AppFormatMode mode) const { |
| 7999 | std::stringstream out; |
no test coverage detected