From: Pieter Noordhuis Date: Wed, 15 Dec 2010 15:02:07 +0000 (+0100) Subject: Specify multi-bulk delimiter via options X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/28c07c7bf80709e7e0be5cac1bbb280cea439272 Specify multi-bulk delimiter via options --- diff --git a/src/redis-cli.c b/src/redis-cli.c index 1e28fb3d..ca70c947 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -530,6 +530,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 +576,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"