| 69 | |
| 70 | template <class T> |
| 71 | void run_command(const std::string& exe_name, |
| 72 | const std::vector<std::string>& args, |
| 73 | bool add_help = false) |
| 74 | { |
| 75 | T x; |
| 76 | argument_parser ap; |
| 77 | ap.set_exe_name(exe_name + " " + command_name<T>()); |
| 78 | if(add_help) |
| 79 | ap(nullptr, {"-h", "--help"}, ap.help("Show help"), ap.show_help()); |
| 80 | x.parse(ap); |
| 81 | if(ap.parse(args)) |
| 82 | return; |
| 83 | x.run(); |
| 84 | } |
| 85 | |
| 86 | template <class T> |
| 87 | int auto_register_command() |
nothing calls this directly
no test coverage detected