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

Function main

examples/prefix_command.cpp:12–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10#include <vector>
11
12int main(int argc, char **argv) {
13
14 CLI::App app("Prefix command app");
15 app.prefix_command(CLI::PrefixCommandMode::On);
16
17 std::vector<int> vals;
18 app.add_option("--vals,-v", vals)->expected(-1);
19
20 CLI11_PARSE(app, argc, argv);
21
22 std::vector<std::string> more_comms = app.remaining();
23
24 std::cout << "Prefix";
25 for(int v : vals)
26 std::cout << ": " << v << " ";
27
28 std::cout << '\n' << "Remaining commands: ";
29
30 for(const auto &com : more_comms)
31 std::cout << com << " ";
32 std::cout << '\n';
33
34 return 0;
35}

Callers

nothing calls this directly

Calls 4

prefix_commandMethod · 0.80
expectedMethod · 0.80
remainingMethod · 0.80
add_optionMethod · 0.45

Tested by

no test coverage detected