MCPcopy Create free account
hub / github.com/CLIUtils/CLI11 / main

Function main

examples/formatter.cpp:18–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16};
17
18int main(int argc, char **argv) {
19 CLI::App app;
20 app.set_help_all_flag("--help-all", "Show all help");
21
22 auto fmt = std::make_shared<MyFormatter>();
23 fmt->column_width(15);
24 app.formatter(fmt);
25
26 app.add_flag("--flag", "This is a flag");
27
28 auto *sub1 = app.add_subcommand("one", "Description One");
29 sub1->add_flag("--oneflag", "Some flag");
30 auto *sub2 = app.add_subcommand("two", "Description Two");
31 sub2->add_flag("--twoflag", "Some other flag");
32
33 CLI11_PARSE(app, argc, argv);
34
35 std::cout << "This app was meant to show off the formatter, run with -h" << '\n';
36
37 return 0;
38}

Callers

nothing calls this directly

Calls 5

set_help_all_flagMethod · 0.80
column_widthMethod · 0.80
formatterMethod · 0.80
add_flagMethod · 0.80
add_subcommandMethod · 0.45

Tested by

no test coverage detected