refactor: Revamp cli with CLI11 App
This commit is contained in:
1 parent
25e07d0a60
commit
66e1b94d1b
65 files changed
+1175
-1186
No files matched your search
@@ -1,18 +1,21 @@
|
||||
#include "ConfigCheck.h"
|
||||
#include "lib/config/ConfigCheck.h"
|
||||
|
||||
namespace bts {
|
||||
namespace cmd {
|
||||
namespace bts::cmds {
|
||||
|
||||
int ConfigCheck::execute(std::vector<std::string> const &args) {
|
||||
static std::vector<std::string> args;
|
||||
|
||||
static void execute() {
|
||||
std::vector<const char *> ch_args;
|
||||
for (auto const &s : args)
|
||||
ch_args.push_back(s.c_str());
|
||||
configcheck(ch_args.size(), &ch_args[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string ConfigCheck::help() { return "Config check help."; }
|
||||
void ConfigCheck::register_cmd(CLI::App &app) {
|
||||
auto *cmd = app.add_subcommand("config-check");
|
||||
cmd->add_option("args", args);
|
||||
cmd->callback(execute);
|
||||
}
|
||||
|
||||
} // namespace cmd
|
||||
} // namespace bts
|
||||
} // namespace bts::cmds
|
||||
Reference in new issue
Block a user