Skip to content

Commit

Permalink
fix: command docs
Browse files Browse the repository at this point in the history
Signed-off-by: kostas <[email protected]>
  • Loading branch information
kostasrim committed Nov 29, 2024
1 parent a4b3724 commit 1e666ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/server/main_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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();
}
Expand Down
4 changes: 4 additions & 0 deletions src/server/server_family_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1e666ff

Please sign in to comment.