Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
xbasel committed Feb 26, 2025
1 parent dc12b53 commit 61559bf
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions src/valkey-cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -2338,22 +2338,24 @@ static int cliSendCommand(int argc, char **argv, long repeat) {
if (context == NULL) return REDIS_ERR;

output_raw = 0;
if (!config.in_multi &&
(!strcasecmp(command, "info") || !strcasecmp(command, "lolwut") ||
(argc >= 2 && !strcasecmp(command, "debug") && !strcasecmp(argv[1], "htstats")) ||
(argc >= 2 && !strcasecmp(command, "debug") && !strcasecmp(argv[1], "htstats-key")) ||
(argc >= 2 && !strcasecmp(command, "debug") && !strcasecmp(argv[1], "client-eviction")) ||
(argc >= 2 && !strcasecmp(command, "memory") &&
(!strcasecmp(argv[1], "malloc-stats") || !strcasecmp(argv[1], "doctor"))) ||
(argc == 2 && !strcasecmp(command, "cluster") &&
(!strcasecmp(argv[1], "nodes") || !strcasecmp(argv[1], "info"))) ||
(argc >= 2 && !strcasecmp(command, "client") &&
(!strcasecmp(argv[1], "list") || !strcasecmp(argv[1], "info"))) ||
(argc == 3 && !strcasecmp(command, "latency") && !strcasecmp(argv[1], "graph")) ||
(argc == 2 && !strcasecmp(command, "latency") && !strcasecmp(argv[1], "doctor")) ||
/* Format PROXY INFO command for Cluster Proxy:
* https://github.com/artix75/redis-cluster-proxy */
(argc >= 2 && !strcasecmp(command, "proxy") && !strcasecmp(argv[1], "info")))) {
if (config.in_multi) {
/* In a multi block, commands will return status instead of verbatim. */
output_raw = 0;
} else if (!strcasecmp(command, "info") || !strcasecmp(command, "lolwut") ||
(argc >= 2 && !strcasecmp(command, "debug") && !strcasecmp(argv[1], "htstats")) ||
(argc >= 2 && !strcasecmp(command, "debug") && !strcasecmp(argv[1], "htstats-key")) ||
(argc >= 2 && !strcasecmp(command, "debug") && !strcasecmp(argv[1], "client-eviction")) ||
(argc >= 2 && !strcasecmp(command, "memory") &&
(!strcasecmp(argv[1], "malloc-stats") || !strcasecmp(argv[1], "doctor"))) ||
(argc == 2 && !strcasecmp(command, "cluster") &&
(!strcasecmp(argv[1], "nodes") || !strcasecmp(argv[1], "info"))) ||
(argc >= 2 && !strcasecmp(command, "client") &&
(!strcasecmp(argv[1], "list") || !strcasecmp(argv[1], "info"))) ||
(argc == 3 && !strcasecmp(command, "latency") && !strcasecmp(argv[1], "graph")) ||
(argc == 2 && !strcasecmp(command, "latency") && !strcasecmp(argv[1], "doctor")) ||
/* Format PROXY INFO command for Cluster Proxy:
* https://github.com/artix75/redis-cluster-proxy */
(argc >= 2 && !strcasecmp(command, "proxy") && !strcasecmp(argv[1], "info"))) {
output_raw = 1;
}

Expand Down

0 comments on commit 61559bf

Please sign in to comment.