X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/a50ea45c841e980f7692a9cd97130f0f37e5917b..ee5cfe385305071ed0ab293be3ad18b13f2f9c86:/redis-cli.c diff --git a/redis-cli.c b/redis-cli.c index 14b24f75..807f676d 100644 --- a/redis-cli.c +++ b/redis-cli.c @@ -141,8 +141,10 @@ 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}, {NULL,0,0} }; @@ -420,7 +422,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 +488,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);