From 7e875bdafe62370f68defb7dee19db732ed9f79a Mon Sep 17 00:00:00 2001 From: s-shiraki <54130718+highpon@users.noreply.github.com> Date: Fri, 2 Feb 2024 04:35:31 +0900 Subject: [PATCH] feat(server): Implement CONFIG HELP command (#2510) * feat(server): Implement CONFIG HELP command * fix --- src/server/server_family.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/server/server_family.cc b/src/server/server_family.cc index bd05b22aa..9013d6740 100644 --- a/src/server/server_family.cc +++ b/src/server/server_family.cc @@ -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 [ [value] [opt] ...]. Subcommands are:", + "GET ", + " Return parameters matching the glob-like and their values.", + "SET ", + " Set the configuration to .", + "RESETSTAT", + " Reset statistics reported by the INFO command.", + "HELP", + " Prints this help.", + }; + + auto* rb = static_cast(cntx->reply_builder()); + return rb->SendSimpleStrArr(help_arr); + } + if (sub_cmd == "SET") { if (args.size() != 3) { return cntx->SendError(WrongNumArgsError("config|set"));