Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
93bdbf5a
Unverified
Commit
93bdbf5a
authored
Jul 15, 2020
by
WuYunlong
Committed by
GitHub
Jul 15, 2020
Browse files
Fix command help for unexpected options (#7476)
parent
dc690161
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/acl.c
View file @
93bdbf5a
...
@@ -1911,7 +1911,7 @@ void aclCommand(client *c) {
...
@@ -1911,7 +1911,7 @@ void aclCommand(client *c) {
addReplyBulkCString
(
c
,
"client-info"
);
addReplyBulkCString
(
c
,
"client-info"
);
addReplyBulkCBuffer
(
c
,
le
->
cinfo
,
sdslen
(
le
->
cinfo
));
addReplyBulkCBuffer
(
c
,
le
->
cinfo
,
sdslen
(
le
->
cinfo
));
}
}
}
else
if
(
!
strcasecmp
(
sub
,
"help"
))
{
}
else
if
(
c
->
argc
==
2
&&
!
strcasecmp
(
sub
,
"help"
))
{
const
char
*
help
[]
=
{
const
char
*
help
[]
=
{
"LOAD -- Reload users from the ACL file."
,
"LOAD -- Reload users from the ACL file."
,
"SAVE -- Save the current config to the ACL file."
,
"SAVE -- Save the current config to the ACL file."
,
...
...
src/latency.c
View file @
93bdbf5a
...
@@ -621,7 +621,7 @@ NULL
...
@@ -621,7 +621,7 @@ NULL
resets
+=
latencyResetEvent
(
c
->
argv
[
j
]
->
ptr
);
resets
+=
latencyResetEvent
(
c
->
argv
[
j
]
->
ptr
);
addReplyLongLong
(
c
,
resets
);
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
);
addReplyHelp
(
c
,
help
);
}
else
{
}
else
{
addReplySubcommandSyntaxError
(
c
);
addReplySubcommandSyntaxError
(
c
);
...
...
src/t_stream.c
View file @
93bdbf5a
...
@@ -1885,7 +1885,7 @@ NULL
...
@@ -1885,7 +1885,7 @@ NULL
server
.
dirty
++
;
server
.
dirty
++
;
notifyKeyspaceEvent
(
NOTIFY_STREAM
,
"xgroup-delconsumer"
,
notifyKeyspaceEvent
(
NOTIFY_STREAM
,
"xgroup-delconsumer"
,
c
->
argv
[
2
],
c
->
db
->
id
);
c
->
argv
[
2
],
c
->
db
->
id
);
}
else
if
(
!
strcasecmp
(
opt
,
"HELP"
))
{
}
else
if
(
c
->
argc
==
2
&&
!
strcasecmp
(
opt
,
"HELP"
))
{
addReplyHelp
(
c
,
help
);
addReplyHelp
(
c
,
help
);
}
else
{
}
else
{
addReplySubcommandSyntaxError
(
c
);
addReplySubcommandSyntaxError
(
c
);
...
...
tests/unit/acl.tcl
View file @
93bdbf5a
...
@@ -255,4 +255,9 @@ start_server {tags {"acl"}} {
...
@@ -255,4 +255,9 @@ start_server {tags {"acl"}} {
r ACL setuser default on
r ACL setuser default on
set e
set e
}
{
*NOAUTH*
}
}
{
*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
}
}
}
tests/unit/latency-monitor.tcl
View file @
93bdbf5a
...
@@ -67,4 +67,9 @@ start_server {tags {"latency-monitor"}} {
...
@@ -67,4 +67,9 @@ start_server {tags {"latency-monitor"}} {
}
}
assert_match
{
*expire-cycle*
}
[
r latency latest
]
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
}
}
}
tests/unit/type/stream.tcl
View file @
93bdbf5a
...
@@ -461,3 +461,10 @@ start_server {tags {"stream"} overrides {appendonly yes aof-use-rdb-preamble no}
...
@@ -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"
}
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
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment