X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/65add0a31189e6257c521df3889f6d9a6d1183f2..5e1d2d30f7b96c0aa808f8c6f9b267880c6097ca:/src/redis-cli.c diff --git a/src/redis-cli.c b/src/redis-cli.c index 1e28fb3d..08b3a713 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -414,10 +414,11 @@ static sds cliFormatReplyRaw(redisReply *r) { } static int cliReadReply(int output_raw_strings) { + void *_reply; redisReply *reply; sds out; - if (redisGetReply(context,(void**)&reply) != REDIS_OK) { + if (redisGetReply(context,&_reply) != REDIS_OK) { if (config.shutdown) return REDIS_OK; if (config.interactive) { @@ -431,6 +432,7 @@ static int cliReadReply(int output_raw_strings) { return REDIS_ERR; /* avoid compiler warning */ } + reply = (redisReply*)_reply; if (output_raw_strings) { out = cliFormatReplyRaw(reply); } else { @@ -530,6 +532,10 @@ static int parseOptions(int argc, char **argv) { i++; } else if (!strcmp(argv[i],"--raw")) { config.raw_output = 1; + } else if (!strcmp(argv[i],"-d") && !lastarg) { + sdsfree(config.mb_delim); + config.mb_delim = sdsnew(argv[i+1]); + i++; } else if (!strcmp(argv[i],"-v") || !strcmp(argv[i], "--version")) { sds version = cliVersion(); printf("redis-cli %s\n", version); @@ -572,6 +578,7 @@ static void usage() { " -r Execute specified command N times\n" " -n Database number\n" " -x Read last argument from STDIN\n" +" -d Multi-bulk delimiter in for raw formatting (default: \\n)\n" " --raw Use raw formatting for replies (default when STDOUT is not a tty)\n" " --help Output this help and exit\n" " --version Output version and exit\n"