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

Function main

examples/doc_simple.cpp:31–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29#include <lyra/lyra.hpp>
30
31int main(int argc, const char ** argv)
32{
33 return lyra::main()
34 (lyra::opt(lyra::val(0), "x")["-x"]) // <1>
35 (lyra::opt(lyra::val(0), "y")["-y"])
36 (lyra::arg(lyra::val(5), "z")) // <2>
37 (argc, argv, [](lyra::main & m)
38 {
39 std::cout << (int(m["-x"]) + int(m["-y"]))*int(m["z"]) << "\n";
40 return 0;
41 });
42}
43// end::doc[]
44/* tag::doc[]
45----

Callers

nothing calls this directly

Calls 3

optClass · 0.50
valFunction · 0.50
argClass · 0.50

Tested by

no test coverage detected