From: antirez Date: Tue, 30 Nov 2010 10:39:55 +0000 (+0100) Subject: minor merge conflicts merging cli-help branch fixed X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/ce260f736e483d40967d3e551f04534154c12aba minor merge conflicts merging cli-help branch fixed --- ce260f736e483d40967d3e551f04534154c12aba diff --cc src/redis-cli.c index 09ab9189,e22ba376..a3987472 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@@ -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 \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; + linenoiseSetCompletionCallback(completionCallback); - while((line = linenoise("redis> ")) != NULL) { ++ + while((line = linenoise(context ? "redis> " : "not connected> ")) != NULL) { if (line[0] != '\0') { argv = sdssplitargs(line,&argc); linenoiseHistoryAdd(line);