| 7877 | } |
| 7878 | |
| 7879 | inline std::string Formatter::make_groups(const App *app, AppFormatMode mode) const { |
| 7880 | std::stringstream out; |
| 7881 | std::vector<std::string> groups = app->get_groups(); |
| 7882 | |
| 7883 | // Options |
| 7884 | for (const std::string &group : groups) { |
| 7885 | std::vector<const Option *> opts = app->get_options([app, mode, &group](const Option *opt) { |
| 7886 | return opt->get_group() == group // Must be in the right group |
| 7887 | && opt->nonpositional() // Must not be a positional |
| 7888 | && (mode != AppFormatMode::Sub // If mode is Sub, then |
| 7889 | || (app->get_help_ptr() != opt // Ignore help pointer |
| 7890 | && app->get_help_all_ptr() != opt)); // Ignore help all pointer |
| 7891 | }); |
| 7892 | if (!group.empty() && !opts.empty()) { |
| 7893 | out << make_group(group, false, opts); |
| 7894 | |
| 7895 | if (group != groups.back()) out << "\n"; |
| 7896 | } |
| 7897 | } |
| 7898 | |
| 7899 | return out.str(); |
| 7900 | } |
| 7901 | |
| 7902 | inline std::string Formatter::make_description(const App *app) const { |
| 7903 | std::string desc = app->get_description(); |
nothing calls this directly
no test coverage detected