From 885b6fc577531b4bb1319ce4a66710b62fa68c84 Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 27 Jun 2014 12:11:15 +0200 Subject: [PATCH] COMMAND COUNT subcommand added. --- src/redis.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/redis.c b/src/redis.c index 393b4225..61d98803 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; } }