1
0
Fork 0
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:
s-shiraki 2024-02-02 04:35:31 +09:00 committed by GitHub
parent b71d0f6383
commit 7e875bdafe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1476,6 +1476,23 @@ void ServerFamily::Config(CmdArgList args, ConnectionContext* cntx) {
ToUpper(&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 (args.size() != 3) {
return cntx->SendError(WrongNumArgsError("config|set"));