Commit 885b6fc5 authored by antirez's avatar antirez
Browse files

COMMAND COUNT subcommand added.

parent a92ae777
...@@ -2466,8 +2466,10 @@ void commandCommand(redisClient *c) { ...@@ -2466,8 +2466,10 @@ void commandCommand(redisClient *c) {
for (i = 2; i < c->argc; i++) { for (i = 2; i < c->argc; i++) {
addReplyCommand(c, dictFetchValue(server.commands, c->argv[i]->ptr)); 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 { } else {
addReplyError(c, "Unknown subcommand."); addReplyError(c, "Unknown subcommand or wrong number of arguments.");
return; return;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment