mirror of
https://github.com/fluencelabs/redis
synced 2025-06-17 03:01:20 +00:00
Added redis-cli interactive help support
updated via commands.json in redis-doc repo. Currently use `make src/help.h` to re-generate. The following are valid from the REPL: help help [command] help [group] help groups ex: help sort help hash
This commit is contained in:
@ -44,6 +44,7 @@
|
||||
#include "adlist.h"
|
||||
#include "zmalloc.h"
|
||||
#include "linenoise.h"
|
||||
#include "help.h"
|
||||
|
||||
#define REDIS_NOTUSED(V) ((void) V)
|
||||
|
||||
@ -248,22 +249,6 @@ static int selectDb(int fd) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void showInteractiveHelp(void) {
|
||||
printf(
|
||||
"\n"
|
||||
"Welcome to redis-cli " REDIS_VERSION "!\n"
|
||||
"Just type any valid Redis command to see a pretty printed output.\n"
|
||||
"\n"
|
||||
"It is possible to quote strings, like in:\n"
|
||||
" set \"my key\" \"some string \\xff\\n\"\n"
|
||||
"\n"
|
||||
"You can find a list of valid Redis commands at\n"
|
||||
" http://code.google.com/p/redis/wiki/CommandReference\n"
|
||||
"\n"
|
||||
"Note: redis-cli supports line editing, use up/down arrows for history."
|
||||
"\n\n");
|
||||
}
|
||||
|
||||
static int cliSendCommand(int argc, char **argv, int repeat) {
|
||||
char *command = argv[0];
|
||||
int fd, j, retval = 0;
|
||||
@ -271,7 +256,7 @@ static int cliSendCommand(int argc, char **argv, int repeat) {
|
||||
|
||||
config.raw_output = !strcasecmp(command,"info");
|
||||
if (!strcasecmp(command,"help")) {
|
||||
showInteractiveHelp();
|
||||
output_help(--argc, ++argv);
|
||||
return 0;
|
||||
}
|
||||
if (!strcasecmp(command,"shutdown")) config.shutdown = 1;
|
||||
|
Reference in New Issue
Block a user