]> git.saurik.com Git - redis.git/blobdiff - redis-cli.c
Fixed a bug in HSET, a memory leak, and a theoretical bug in dict.c
[redis.git] / redis-cli.c
index 14b24f7538eb6365e20ad794efe8aae3622f39b0..03755efaca89a7af35d239c21bd539ad288496ae 100644 (file)
@@ -101,8 +101,11 @@ static struct redisCommand cmdTable[] = {
     {"zincrby",4,REDIS_CMD_BULK},
     {"zrem",3,REDIS_CMD_BULK},
     {"zremrangebyscore",4,REDIS_CMD_INLINE},
+    {"zmerge",-3,REDIS_CMD_INLINE},
+    {"zmergeweighed",-4,REDIS_CMD_INLINE},
     {"zrange",-4,REDIS_CMD_INLINE},
     {"zrank",3,REDIS_CMD_BULK},
+    {"zrevrank",3,REDIS_CMD_BULK},
     {"zrangebyscore",-4,REDIS_CMD_INLINE},
     {"zcount",4,REDIS_CMD_INLINE},
     {"zrevrange",-4,REDIS_CMD_INLINE},
@@ -141,8 +144,15 @@ static struct redisCommand cmdTable[] = {
     {"msetnx",-3,REDIS_CMD_MULTIBULK},
     {"monitor",1,REDIS_CMD_INLINE},
     {"multi",1,REDIS_CMD_INLINE},
-    {"exec",1,REDIS_CMD_MULTIBULK},
+    {"exec",1,REDIS_CMD_INLINE},
     {"discard",1,REDIS_CMD_INLINE},
+    {"hset",4,REDIS_CMD_MULTIBULK},
+    {"hget",3,REDIS_CMD_BULK},
+    {"hdel",3,REDIS_CMD_BULK},
+    {"hlen",2,REDIS_CMD_INLINE},
+    {"hkeys",2,REDIS_CMD_INLINE},
+    {"hvals",2,REDIS_CMD_INLINE},
+    {"hgetall",2,REDIS_CMD_INLINE},
     {NULL,0,0}
 };
 
@@ -420,7 +430,7 @@ static void usage() {
     fprintf(stderr, "example: cat /etc/passwd | redis-cli set my_passwd\n");
     fprintf(stderr, "example: redis-cli get my_passwd\n");
     fprintf(stderr, "example: redis-cli -r 100 lpush mylist x\n");
-    fprintf(stderr, "\nRun in interactive mode: redis-cli -i \n");
+    fprintf(stderr, "\nRun in interactive mode: redis-cli -i or just don't pass any command\n");
     exit(1);
 }
 
@@ -486,12 +496,10 @@ int main(int argc, char **argv) {
     config.interactive = 0;
 
     firstarg = parseOptions(argc,argv);
-
     argc -= firstarg;
     argv += firstarg;
 
-    if (config.interactive == 1) repl();
-    if (argc < 1) usage();
+    if (argc == 0 || config.interactive == 1) repl();
 
     argvcopy = convertToSds(argc, argv);