Skip to content

Commit

Permalink
redis-cli: support for REDIS_REPLY_SET in CSV and RAW output. (redis#…
Browse files Browse the repository at this point in the history
…7338)

Fixes redis#6792. Added support of REDIS_REPLY_SET in raw and csv output of `./redis-cli`

Test:

run commands to test:
  ./redis-cli -3 --csv COMMAND
  ./redis-cli -3 --raw COMMAND

Now they are returning resuts, were failing with: "Unknown reply type: 10" before the change.
  • Loading branch information
mgalushka committed Jun 21, 2021
1 parent 1fabb89 commit 96bb078
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/redis-cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,7 @@ static sds cliFormatReplyRaw(redisReply *r) {
case REDIS_REPLY_DOUBLE:
out = sdscatprintf(out,"%s",r->str);
break;
case REDIS_REPLY_SET:
case REDIS_REPLY_ARRAY:
case REDIS_REPLY_PUSH:
for (i = 0; i < r->elements; i++) {
Expand Down Expand Up @@ -1217,6 +1218,7 @@ static sds cliFormatReplyCSV(redisReply *r) {
out = sdscat(out,r->integer ? "true" : "false");
break;
case REDIS_REPLY_ARRAY:
case REDIS_REPLY_SET:
case REDIS_REPLY_PUSH:
case REDIS_REPLY_MAP: /* CSV has no map type, just output flat list. */
for (i = 0; i < r->elements; i++) {
Expand Down

0 comments on commit 96bb078

Please sign in to comment.