]> git.saurik.com Git - redis.git/blobdiff - redis-cli.c
basic VM mostly working!
[redis.git] / redis-cli.c
index bcef3c1e6800686b4ca519e50fc5e81917ae2164..a082a9bb9b22d042a02ba297b5534e1877f1b91d 100644 (file)
@@ -71,6 +71,8 @@ static struct redisCommand cmdTable[] = {
     {"lpush",3,REDIS_CMD_BULK},
     {"rpop",2,REDIS_CMD_INLINE},
     {"lpop",2,REDIS_CMD_INLINE},
+    {"brpop",-3,REDIS_CMD_INLINE},
+    {"blpop",-3,REDIS_CMD_INLINE},
     {"llen",2,REDIS_CMD_INLINE},
     {"lindex",3,REDIS_CMD_INLINE},
     {"lset",4,REDIS_CMD_BULK},
@@ -96,9 +98,9 @@ static struct redisCommand cmdTable[] = {
     {"zincrby",4,REDIS_CMD_BULK},
     {"zrem",3,REDIS_CMD_BULK},
     {"zremrangebyscore",4,REDIS_CMD_INLINE},
-    {"zrange",4,REDIS_CMD_INLINE},
+    {"zrange",-4,REDIS_CMD_INLINE},
     {"zrangebyscore",-4,REDIS_CMD_INLINE},
-    {"zrevrange",4,REDIS_CMD_INLINE},
+    {"zrevrange",-4,REDIS_CMD_INLINE},
     {"zcard",2,REDIS_CMD_INLINE},
     {"zscore",3,REDIS_CMD_BULK},
     {"incrby",3,REDIS_CMD_INLINE},
@@ -311,7 +313,8 @@ static int cliSendCommand(int argc, char **argv) {
         if (rc->flags & REDIS_CMD_MULTIBULK) {
             cmd = sdscatprintf(cmd,"*%d\r\n",argc);
             for (j = 0; j < argc; j++) {
-                cmd = sdscatprintf(cmd,"$%lu\r\n",sdslen(argv[j]));
+                cmd = sdscatprintf(cmd,"$%lu\r\n",
+                    (unsigned long)sdslen(argv[j]));
                 cmd = sdscatlen(cmd,argv[j],sdslen(argv[j]));
                 cmd = sdscatlen(cmd,"\r\n",2);
             }
@@ -319,7 +322,8 @@ static int cliSendCommand(int argc, char **argv) {
             for (j = 0; j < argc; j++) {
                 if (j != 0) cmd = sdscat(cmd," ");
                 if (j == argc-1 && rc->flags & REDIS_CMD_BULK) {
-                    cmd = sdscatprintf(cmd,"%lu",sdslen(argv[j]));
+                    cmd = sdscatprintf(cmd,"%lu",
+                        (unsigned long)sdslen(argv[j]));
                 } else {
                     cmd = sdscatlen(cmd,argv[j],sdslen(argv[j]));
                 }