mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2024-12-14 11:58:02 +00:00
feat(server): Implement CONFIG HELP command (#2510)
* feat(server): Implement CONFIG HELP command * fix
This commit is contained in:
parent
b71d0f6383
commit
7e875bdafe
1 changed files with 17 additions and 0 deletions
|
@ -1476,6 +1476,23 @@ void ServerFamily::Config(CmdArgList args, ConnectionContext* cntx) {
|
||||||
ToUpper(&args[0]);
|
ToUpper(&args[0]);
|
||||||
string_view sub_cmd = ArgS(args, 0);
|
string_view sub_cmd = ArgS(args, 0);
|
||||||
|
|
||||||
|
if (sub_cmd == "HELP") {
|
||||||
|
string_view help_arr[] = {
|
||||||
|
"CONFIG <subcommand> [<arg> [value] [opt] ...]. Subcommands are:",
|
||||||
|
"GET <pattern>",
|
||||||
|
" Return parameters matching the glob-like <pattern> and their values.",
|
||||||
|
"SET <directive> <value>",
|
||||||
|
" Set the configuration <directive> to <value>.",
|
||||||
|
"RESETSTAT",
|
||||||
|
" Reset statistics reported by the INFO command.",
|
||||||
|
"HELP",
|
||||||
|
" Prints this help.",
|
||||||
|
};
|
||||||
|
|
||||||
|
auto* rb = static_cast<RedisReplyBuilder*>(cntx->reply_builder());
|
||||||
|
return rb->SendSimpleStrArr(help_arr);
|
||||||
|
}
|
||||||
|
|
||||||
if (sub_cmd == "SET") {
|
if (sub_cmd == "SET") {
|
||||||
if (args.size() != 3) {
|
if (args.size() != 3) {
|
||||||
return cntx->SendError(WrongNumArgsError("config|set"));
|
return cntx->SendError(WrongNumArgsError("config|set"));
|
||||||
|
|
Loading…
Reference in a new issue