X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/7db723adb22bb98f3c3ca5bf4c35636ee75b25ba..8879cbfe600cd6849f95c4bc7234f72f6e7331d4:/redis-cli.c diff --git a/redis-cli.c b/redis-cli.c index f34aef83..32e77e4c 100644 --- a/redis-cli.c +++ b/redis-cli.c @@ -42,7 +42,7 @@ #define REDIS_CMD_INLINE 1 #define REDIS_CMD_BULK 2 -#define REDIS_CMD_MULTIBULK 3 +#define REDIS_CMD_MULTIBULK 4 #define REDIS_NOTUSED(V) ((void) V) @@ -97,7 +97,7 @@ static struct redisCommand cmdTable[] = { {"zrem",3,REDIS_CMD_BULK}, {"zremrangebyscore",4,REDIS_CMD_INLINE}, {"zrange",4,REDIS_CMD_INLINE}, - {"zrangebyscore",4,REDIS_CMD_INLINE}, + {"zrangebyscore",-4,REDIS_CMD_INLINE}, {"zrevrange",4,REDIS_CMD_INLINE}, {"zcard",2,REDIS_CMD_INLINE}, {"zscore",3,REDIS_CMD_BULK}, @@ -115,6 +115,8 @@ static struct redisCommand cmdTable[] = { {"echo",2,REDIS_CMD_BULK}, {"save",1,REDIS_CMD_INLINE}, {"bgsave",1,REDIS_CMD_INLINE}, + {"rewriteaof",1,REDIS_CMD_INLINE}, + {"bgrewriteaof",1,REDIS_CMD_INLINE}, {"shutdown",1,REDIS_CMD_INLINE}, {"lastsave",1,REDIS_CMD_INLINE}, {"type",2,REDIS_CMD_INLINE}, @@ -309,7 +311,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,"$%d\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); } @@ -317,7 +320,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,"%d",sdslen(argv[j])); + cmd = sdscatprintf(cmd,"%lu", + (unsigned long)sdslen(argv[j])); } else { cmd = sdscatlen(cmd,argv[j],sdslen(argv[j])); }