diff options
author | antirez <antirez@gmail.com> | 2014-06-27 12:11:15 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2014-06-27 12:11:15 +0200 |
commit | 885b6fc577531b4bb1319ce4a66710b62fa68c84 (patch) | |
tree | dd8f219d75939376070b09b611617cce77f967fd | |
parent | a92ae7774052ebdb305249ac548d5ed4f7887b82 (diff) | |
download | redis-885b6fc577531b4bb1319ce4a66710b62fa68c84.tar.gz |
COMMAND COUNT subcommand added.
-rw-r--r-- | src/redis.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/redis.c b/src/redis.c index 393b42255..61d988030 100644 --- a/src/redis.c +++ b/src/redis.c @@ -2466,8 +2466,10 @@ void commandCommand(redisClient *c) { for (i = 2; i < c->argc; i++) { addReplyCommand(c, dictFetchValue(server.commands, c->argv[i]->ptr)); } + } else if (!strcasecmp(c->argv[1]->ptr, "count") && c->argc == 2) { + addReplyLongLong(c, dictSize(server.commands)); } else { - addReplyError(c, "Unknown subcommand."); + addReplyError(c, "Unknown subcommand or wrong number of arguments."); return; } } |