Unverified Commit b1099773 authored by Binbin's avatar Binbin Committed by GitHub
Browse files

Fix XINFO help for unexpected options. (#9075)

Small cleanup and consistency.
parent 096c5fd5
...@@ -3459,6 +3459,11 @@ void xinfoCommand(client *c) { ...@@ -3459,6 +3459,11 @@ void xinfoCommand(client *c) {
/* HELP is special. Handle it ASAP. */ /* HELP is special. Handle it ASAP. */
if (!strcasecmp(c->argv[1]->ptr,"HELP")) { if (!strcasecmp(c->argv[1]->ptr,"HELP")) {
if (c->argc != 2) {
addReplySubcommandSyntaxError(c);
return;
}
const char *help[] = { const char *help[] = {
"CONSUMERS <key> <groupname>", "CONSUMERS <key> <groupname>",
" Show consumers of <groupname>.", " Show consumers of <groupname>.",
......
...@@ -714,4 +714,9 @@ start_server {tags {"stream"}} { ...@@ -714,4 +714,9 @@ start_server {tags {"stream"}} {
catch {r XGROUP help xxx} e catch {r XGROUP help xxx} e
assert_match "*Unknown subcommand or wrong number of arguments*" $e assert_match "*Unknown subcommand or wrong number of arguments*" $e
} }
test {XINFO HELP should not have unexpected options} {
catch {r XINFO help xxx} e
assert_match "*Unknown subcommand or wrong number of arguments*" $e
}
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment