mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
Fix command help for unexpected options (#7476)
This commit is contained in:
parent
dc690161d5
commit
93bdbf5aa4
@ -1911,7 +1911,7 @@ void aclCommand(client *c) {
|
||||
addReplyBulkCString(c,"client-info");
|
||||
addReplyBulkCBuffer(c,le->cinfo,sdslen(le->cinfo));
|
||||
}
|
||||
} else if (!strcasecmp(sub,"help")) {
|
||||
} else if (c->argc == 2 && !strcasecmp(sub,"help")) {
|
||||
const char *help[] = {
|
||||
"LOAD -- Reload users from the ACL file.",
|
||||
"SAVE -- Save the current config to the ACL file.",
|
||||
|
@ -621,7 +621,7 @@ NULL
|
||||
resets += latencyResetEvent(c->argv[j]->ptr);
|
||||
addReplyLongLong(c,resets);
|
||||
}
|
||||
} else if (!strcasecmp(c->argv[1]->ptr,"help") && c->argc >= 2) {
|
||||
} else if (!strcasecmp(c->argv[1]->ptr,"help") && c->argc == 2) {
|
||||
addReplyHelp(c, help);
|
||||
} else {
|
||||
addReplySubcommandSyntaxError(c);
|
||||
|
@ -1885,7 +1885,7 @@ NULL
|
||||
server.dirty++;
|
||||
notifyKeyspaceEvent(NOTIFY_STREAM,"xgroup-delconsumer",
|
||||
c->argv[2],c->db->id);
|
||||
} else if (!strcasecmp(opt,"HELP")) {
|
||||
} else if (c->argc == 2 && !strcasecmp(opt,"HELP")) {
|
||||
addReplyHelp(c, help);
|
||||
} else {
|
||||
addReplySubcommandSyntaxError(c);
|
||||
|
@ -255,4 +255,9 @@ start_server {tags {"acl"}} {
|
||||
r ACL setuser default on
|
||||
set e
|
||||
} {*NOAUTH*}
|
||||
|
||||
test {ACL HELP should not have unexpected options} {
|
||||
catch {r ACL help xxx} e
|
||||
assert_match "*Unknown subcommand or wrong number of arguments*" $e
|
||||
}
|
||||
}
|
||||
|
@ -67,4 +67,9 @@ start_server {tags {"latency-monitor"}} {
|
||||
}
|
||||
assert_match {*expire-cycle*} [r latency latest]
|
||||
}
|
||||
|
||||
test {LATENCY HELP should not have unexpected options} {
|
||||
catch {r LATENCY help xxx} e
|
||||
assert_match "*Unknown subcommand or wrong number of arguments*" $e
|
||||
}
|
||||
}
|
||||
|
@ -461,3 +461,10 @@ start_server {tags {"stream"} overrides {appendonly yes aof-use-rdb-preamble no}
|
||||
assert {[dict get [r xinfo stream mystream] last-generated-id] == "2-2"}
|
||||
}
|
||||
}
|
||||
|
||||
start_server {tags {"stream"}} {
|
||||
test {XGROUP HELP should not have unexpected options} {
|
||||
catch {r XGROUP help xxx} e
|
||||
assert_match "*Unknown subcommand or wrong number of arguments*" $e
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user