| 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 | { |