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

Function main

examples/subcom_help.cpp:11–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include <string>
10
11int main(int argc, char *argv[]) {
12 CLI::App cli_global{"Demo app"};
13 auto &cli_sub = *cli_global.add_subcommand("sub", "Some subcommand");
14 std::string sub_arg;
15 cli_sub.add_option("sub_arg", sub_arg, "Argument for subcommand")->required();
16 CLI11_PARSE(cli_global, argc, argv);
17 if(cli_sub) {
18 std::cout << "Got: " << sub_arg << '\n';
19 }
20 return 0;
21}

Callers

nothing calls this directly

Calls 3

add_subcommandMethod · 0.45
requiredMethod · 0.45
add_optionMethod · 0.45

Tested by

no test coverage detected