MCPcopy Create free account
hub / github.com/bfgroup/Lyra / main

Function main

examples/doc_example4.cpp:12–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10#include <lyra/lyra.hpp>
11
12int main(int argc, const char** argv)
13{
14 int repeat = 0;
15 std::string message;
16 // Ex: <exe> --repeat=10 "Hello world."
17 auto cli
18 = lyra::opt(repeat, "-repeat")["--repeat"]
19 | lyra::arg(message, "message");
20 if (cli.parse({ argc, argv }))
21 {
22 for (int count = 0; count < repeat; ++count)
23 std::cout << message << "\n";
24 }
25 return 0;
26}
27// end::part1[]

Callers

nothing calls this directly

Calls 3

optClass · 0.50
argClass · 0.50
parseMethod · 0.45

Tested by

no test coverage detected