1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-14 11:58:02 +00:00

fix: command docs (#4229)

Signed-off-by: kostas <kostas@dragonflydb.io>
This commit is contained in:
Kostas Kyrimis 2024-11-30 15:53:22 +01:00 committed by GitHub
parent a4b3724929
commit 872e49b0b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -2450,7 +2450,7 @@ void Service::Command(CmdArgList args, Transaction* tx, SinkReplyBuilder* builde
return builder->SendLong(cmd_cnt);
}
const bool sufficient_args = (args.size() == 2);
bool sufficient_args = (args.size() == 2);
// INFO [cmd]
if (subcmd == "INFO" && sufficient_args) {
@ -2466,6 +2466,7 @@ void Service::Command(CmdArgList args, Transaction* tx, SinkReplyBuilder* builde
return;
}
sufficient_args = (args.size() == 1);
if (subcmd == "DOCS" && sufficient_args) {
return builder->SendOk();
}

View file

@ -545,4 +545,8 @@ TEST_F(ServerFamilyTest, ConfigNormalization) {
RespArray(ElementsAre("replica_priority", "13")));
}
TEST_F(ServerFamilyTest, CommandDocsOk) {
EXPECT_THAT(Run({"command", "docs"}), "OK");
}
} // namespace dfly