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

Method add_command

examples/doc_commands.cpp:45–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43 bool show_help = false;
44
45 void add_command(lyra::group & g) // <3>
46 {
47 g.add_argument(lyra::command("run",
48 [this](const lyra::group & f) { this->do_command(f); }) // <4>
49 .help("Execute the given command.")
50 .add_argument(lyra::help(show_help))
51 .add_argument(lyra::opt(verbose)
52 .name("-v")
53 .name("--verbose")
54 .optional()
55 .help(
56 "Show additional output as to what we are doing."))
57 .add_argument(lyra::arg(command, "command")
58 .required()
59 .help(
60 "The command, and arguments, to attempt to run.")));
61 }
62
63 void do_command(const lyra::group & g)
64 {

Callers 1

mainFunction · 0.45

Calls 9

do_commandMethod · 0.95
commandClass · 0.50
helpClass · 0.50
optClass · 0.50
argClass · 0.50
helpMethod · 0.45
optionalMethod · 0.45
nameMethod · 0.45
requiredMethod · 0.45

Tested by

no test coverage detected