]> git.saurik.com Git - redis.git/blobdiff - redis-cli.c
Merge branch 'integration' of git://github.com/pietern/redis
[redis.git] / redis-cli.c
index 22a09e79693d2da1c5473a780a95aee72f2371f1..863df9bf857f81d19d118ad26999b276d7b7ace8 100644 (file)
@@ -112,8 +112,8 @@ static struct redisCommand cmdTable[] = {
     {"zincrby",4,CMDFLAG_NONE},
     {"zrem",3,CMDFLAG_NONE},
     {"zremrangebyscore",4,CMDFLAG_NONE},
-    {"zmerge",-3,CMDFLAG_NONE},
-    {"zmergeweighed",-4,CMDFLAG_NONE},
+    {"zunion",-4,CMDFLAG_NONE},
+    {"zinter",-4,CMDFLAG_NONE},
     {"zrange",-4,CMDFLAG_NONE},
     {"zrank",3,CMDFLAG_NONE},
     {"zrevrank",3,CMDFLAG_NONE},
@@ -356,20 +356,23 @@ static int selectDb(int fd) {
 
 static int cliSendCommand(int argc, char **argv, int repeat) {
     struct redisCommand *rc = lookupCommand(argv[0]);
+    int shutdown = 0;
     int fd, j, retval = 0;
     sds cmd;
 
-    config.raw_output = (rc->flags & CMDFLAG_RAWOUTPUT);
     if (!rc) {
         fprintf(stderr,"Unknown command '%s'\n",argv[0]);
         return 1;
     }
+    config.raw_output = (rc->flags & CMDFLAG_RAWOUTPUT);
 
     if ((rc->arity > 0 && argc != rc->arity) ||
         (rc->arity < 0 && argc < -rc->arity)) {
             fprintf(stderr,"Wrong number of arguments for '%s'\n",rc->name);
             return 1;
     }
+
+    if (!strcasecmp(rc->name,"shutdown")) shutdown = 1;
     if (!strcasecmp(rc->name,"monitor")) config.monitor_mode = 1;
     if (!strcasecmp(rc->name,"subscribe") ||
         !strcasecmp(rc->name,"psubscribe")) config.pubsub_mode = 1;
@@ -408,7 +411,7 @@ static int cliSendCommand(int argc, char **argv, int repeat) {
 
         retval = cliReadReply(fd);
         if (retval) {
-            return retval;
+            return shutdown ? 0 : retval;
         }
     }
     return 0;