Skip to content

Commit 6a8f068

Browse files
Adding Missing filters to CLIENT LIST and Dedup Parsing (#1401)
Adds filter options to CLIENT LIST: * USER <username> Return clients authenticated by <username>. * ADDR <ip:port> Return clients connected from the specified address. * LADDR <ip:port> Return clients connected to the specified local address. * SKIPME (YES|NO) Exclude the current client from the list (default: no). * MAXAGE <maxage> Only list connections older than the specified age. Modifies the ID filter to CLIENT KILL to allow multiple IDs * ID <client-id> [<client-id>...] Kill connections by client ids. This makes CLIENT LIST and CLIENT KILL accept the same options. For backward compatibility, the default value for SKIPME is NO for CLIENT LIST and YES for CLIENT KILL. The MAXAGE comes from CLIENT KILL, where it *keeps* clients with the given max age and kills the older ones. This logic becomes weird for CLIENT LIST, but is kept for similary with CLIENT KILL, for the use case of first testing manually using CLIENT LIST, and then running CLIENT KILL with the same filters. The `ID client-id [client-id ...]` no longer needs to be the last filter. The parsing logic determines if an argument is an ID or not based on whether it can be parsed as an integer or not. Partly addresses: #668 --------- Signed-off-by: Sarthak Aggarwal <[email protected]>
1 parent c5a1585 commit 6a8f068

24 files changed

+867
-535
lines changed

src/commands.def

Lines changed: 34 additions & 21 deletions
Large diffs are not rendered by default.

src/commands/client-caching.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"since": "6.0.0",
77
"arity": 3,
88
"container": "CLIENT",
9-
"function": "clientCommand",
9+
"function": "clientCachingCommand",
1010
"command_flags": [
1111
"NOSCRIPT",
1212
"LOADING",

src/commands/client-capa.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"since": "8.0.0",
77
"arity": -3,
88
"container": "CLIENT",
9-
"function": "clientCommand",
9+
"function": "clientCapaCommand",
1010
"command_flags": [
1111
"NOSCRIPT",
1212
"LOADING",

src/commands/client-getname.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"since": "2.6.9",
77
"arity": 2,
88
"container": "CLIENT",
9-
"function": "clientCommand",
9+
"function": "clientGetNameCommand",
1010
"command_flags": [
1111
"NOSCRIPT",
1212
"LOADING",

src/commands/client-getredir.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"since": "6.0.0",
77
"arity": 2,
88
"container": "CLIENT",
9-
"function": "clientCommand",
9+
"function": "clientGetredirCommand",
1010
"command_flags": [
1111
"NOSCRIPT",
1212
"LOADING",

src/commands/client-help.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"since": "5.0.0",
77
"arity": 2,
88
"container": "CLIENT",
9-
"function": "clientCommand",
9+
"function": "clientHelpCommand",
1010
"command_flags": [
1111
"LOADING",
1212
"STALE",

src/commands/client-id.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"since": "5.0.0",
77
"arity": 2,
88
"container": "CLIENT",
9-
"function": "clientCommand",
9+
"function": "clientIDCommand",
1010
"command_flags": [
1111
"NOSCRIPT",
1212
"LOADING",

src/commands/client-import-source.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"since": "8.1.0",
77
"arity": 3,
88
"container": "CLIENT",
9-
"function": "clientCommand",
9+
"function": "clientImportSourceCommand",
1010
"command_flags": [
1111
"NOSCRIPT",
1212
"LOADING",

src/commands/client-info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"since": "6.2.0",
77
"arity": 2,
88
"container": "CLIENT",
9-
"function": "clientCommand",
9+
"function": "clientInfoCommand",
1010
"command_flags": [
1111
"NOSCRIPT",
1212
"LOADING",

src/commands/client-kill.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"since": "2.4.0",
77
"arity": -3,
88
"container": "CLIENT",
9-
"function": "clientCommand",
9+
"function": "clientKillCommand",
1010
"history": [
1111
[
1212
"2.8.12",
@@ -35,6 +35,10 @@
3535
[
3636
"8.0.0",
3737
"Replaced `master` `TYPE` with `primary`. `master` still supported for backward compatibility."
38+
],
39+
[
40+
"8.1.0",
41+
"`ID` option accepts multiple IDs."
3842
]
3943
],
4044
"command_flags": [
@@ -68,6 +72,7 @@
6872
"name": "client-id",
6973
"type": "integer",
7074
"optional": true,
75+
"multiple": true,
7176
"since": "2.8.12"
7277
},
7378
{

0 commit comments

Comments
 (0)