]> git.saurik.com Git - redis.git/commitdiff
minor merge conflicts merging cli-help branch fixed
authorantirez <antirez@gmail.com>
Tue, 30 Nov 2010 10:39:55 +0000 (11:39 +0100)
committerantirez <antirez@gmail.com>
Tue, 30 Nov 2010 10:39:55 +0000 (11:39 +0100)
1  2 
src/redis-cli.c

diff --cc src/redis-cli.c
index 09ab9189fa48974ea8c6b62cbfeb4bd17367c9a1,e22ba3766a46152891795984a707655c2fa4bb2f..a3987472283bd9de657464f7e143a724cc3daf55
@@@ -273,14 -402,9 +402,14 @@@ static int cliSendCommand(int argc, cha
      size_t *argvlen;
      int j;
  
 +    if (context == NULL) {
 +        printf("Not connected, please use: connect <host> <port>\n");
 +        return REDIS_OK;
 +    }
 +
      config.raw_output = !strcasecmp(command,"info");
-     if (!strcasecmp(command,"help")) {
-         showInteractiveHelp();
+     if (!strcasecmp(command,"help") || !strcasecmp(command,"?")) {
+         cliOutputHelp(--argc, ++argv);
          return REDIS_OK;
      }
      if (!strcasecmp(command,"shutdown")) config.shutdown = 1;
@@@ -412,7 -535,8 +541,9 @@@ static void repl() 
      sds *argv;
  
      config.interactive = 1;
 -    while((line = linenoise("redis> ")) != NULL) {
+     linenoiseSetCompletionCallback(completionCallback);
++
 +    while((line = linenoise(context ? "redis> " : "not connected> ")) != NULL) {
          if (line[0] != '\0') {
              argv = sdssplitargs(line,&argc);
              linenoiseHistoryAdd(line);