MCPcopy Create free account
hub / github.com/Tencent/TAD_Sim / make_groups

Method make_groups

simcore/framework/src/cli/cli.hpp:7879–7900  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7877}
7878
7879inline 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
7902inline std::string Formatter::make_description(const App *app) const {
7903 std::string desc = app->get_description();

Callers

nothing calls this directly

Calls 8

get_groupsMethod · 0.80
get_optionsMethod · 0.80
nonpositionalMethod · 0.80
get_help_ptrMethod · 0.80
get_help_all_ptrMethod · 0.80
backMethod · 0.80
strMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected