Commit a8a32755 authored by antirez's avatar antirez
Browse files

Redis-cli should accept help command even if there is no connection to the server.

parent bd624d0f
...@@ -466,6 +466,11 @@ static int cliSendCommand(int argc, char **argv, int repeat) { ...@@ -466,6 +466,11 @@ static int cliSendCommand(int argc, char **argv, int repeat) {
size_t *argvlen; size_t *argvlen;
int j, output_raw; int j, output_raw;
if (!strcasecmp(command,"help") || !strcasecmp(command,"?")) {
cliOutputHelp(--argc, ++argv);
return REDIS_OK;
}
if (context == NULL) return REDIS_ERR; if (context == NULL) return REDIS_ERR;
output_raw = 0; output_raw = 0;
...@@ -477,10 +482,6 @@ static int cliSendCommand(int argc, char **argv, int repeat) { ...@@ -477,10 +482,6 @@ static int cliSendCommand(int argc, char **argv, int repeat) {
output_raw = 1; output_raw = 1;
} }
if (!strcasecmp(command,"help") || !strcasecmp(command,"?")) {
cliOutputHelp(--argc, ++argv);
return REDIS_OK;
}
if (!strcasecmp(command,"shutdown")) config.shutdown = 1; if (!strcasecmp(command,"shutdown")) config.shutdown = 1;
if (!strcasecmp(command,"monitor")) config.monitor_mode = 1; if (!strcasecmp(command,"monitor")) config.monitor_mode = 1;
if (!strcasecmp(command,"subscribe") || if (!strcasecmp(command,"subscribe") ||
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment