]> git.saurik.com Git - redis.git/commitdiff
Redis-cli should accept help command even if there is no connection to the server.
authorantirez <antirez@gmail.com>
Wed, 22 Feb 2012 14:16:11 +0000 (15:16 +0100)
committerantirez <antirez@gmail.com>
Wed, 22 Feb 2012 14:16:11 +0000 (15:16 +0100)
src/redis-cli.c

index 3f60a1329db72048ff8a9e0e6391d79e9b081f18..692736c7bfdb31c8d2913adfd47332d6792301aa 100644 (file)
@@ -501,6 +501,11 @@ static int cliSendCommand(int argc, char **argv, int repeat) {
     size_t *argvlen;
     int j, output_raw;
 
+    if (!strcasecmp(command,"help") || !strcasecmp(command,"?")) {
+        cliOutputHelp(--argc, ++argv);
+        return REDIS_OK;
+    }
+
     if (context == NULL) return REDIS_ERR;
 
     output_raw = 0;
@@ -515,10 +520,6 @@ static int cliSendCommand(int argc, char **argv, int repeat) {
         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,"monitor")) config.monitor_mode = 1;
     if (!strcasecmp(command,"subscribe") ||