| 9 | #include <string> |
| 10 | |
| 11 | int 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 | } |
nothing calls this directly
no test coverage detected