Fix XINFO help for unexpected options. (#9075)

Small cleanup and consistency.
This commit is contained in:
Binbin 2021-06-15 15:01:11 +08:00 committed by GitHub
parent 096c5fd5d2
commit b109977301
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -3459,6 +3459,11 @@ void xinfoCommand(client *c) {
/* HELP is special. Handle it ASAP. */
if (!strcasecmp(c->argv[1]->ptr,"HELP")) {
if (c->argc != 2) {
addReplySubcommandSyntaxError(c);
return;
}
const char *help[] = {
"CONSUMERS <key> <groupname>",
" Show consumers of <groupname>.",

View File

@ -714,4 +714,9 @@ start_server {tags {"stream"}} {
catch {r XGROUP help xxx} 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
}
}