From 426553164d6807e67999101cec95d2afb7aaa3d7 Mon Sep 17 00:00:00 2001
From: Matt Stancliff <matt@genges.com>
Date: Fri, 1 Aug 2014 12:05:04 -0400
Subject: [PATCH] redis-cli: Add --no-raw option

Some people need formatted output even when they have no
interactive tty.

Fixes #760
---
 src/redis-cli.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/redis-cli.c b/src/redis-cli.c
index 28d3e0cd..a9633c07 100644
--- a/src/redis-cli.c
+++ b/src/redis-cli.c
@@ -731,6 +731,8 @@ static int parseOptions(int argc, char **argv) {
             config.auth = argv[++i];
         } else if (!strcmp(argv[i],"--raw")) {
             config.output = OUTPUT_RAW;
+        } else if (!strcmp(argv[i],"--no-raw")) {
+            config.output = OUTPUT_STANDARD;
         } else if (!strcmp(argv[i],"--csv")) {
             config.output = OUTPUT_CSV;
         } else if (!strcmp(argv[i],"--latency")) {
@@ -821,6 +823,7 @@ static void usage() {
 "  -c                 Enable cluster mode (follow -ASK and -MOVED redirections).\n"
 "  --raw              Use raw formatting for replies (default when STDOUT is\n"
 "                     not a tty).\n"
+"  --no-raw           Force formatted output even when STDOUT is not a tty.\n"
 "  --csv              Output in CSV format.\n"
 "  --latency          Enter a special mode continuously sampling latency.\n"
 "  --latency-history  Like --latency but tracking latency changes over time.\n"