(ws) add bare bone redis-cli like sub-command, with command line editing powered by libnoise

This commit is contained in:
Benjamin Sergeant
2020-06-11 17:30:42 -07:00
parent 35d76c20dc
commit ac9710d5d6
9 changed files with 182 additions and 12 deletions

View File

@ -281,6 +281,12 @@ int main(int argc, char** argv)
httpClientApp->add_option("--transfer-timeout", transferTimeout, "Transfer timeout");
addTLSOptions(httpClientApp);
CLI::App* redisCliApp = app.add_subcommand("redis_cli", "Redis cli");
redisCliApp->fallthrough();
redisCliApp->add_option("--port", redisPort, "Port");
redisCliApp->add_option("--host", hostname, "Hostname");
redisCliApp->add_option("--password", password, "Password");
CLI::App* redisPublishApp = app.add_subcommand("redis_publish", "Redis publisher");
redisPublishApp->fallthrough();
redisPublishApp->add_option("--port", redisPort, "Port");
@ -531,6 +537,10 @@ int main(int argc, char** argv)
compress,
tlsOptions);
}
else if (app.got_subcommand("redis_cli"))
{
ret = ix::ws_redis_cli_main(hostname, redisPort, password);
}
else if (app.got_subcommand("redis_publish"))
{
ret = ix::ws_redis_publish_main(hostname, redisPort, password, channel, message, count);