summaryrefslogtreecommitdiff
path: root/src/debug.c
diff options
context:
space:
mode:
authorSalvatore Sanfilippo <antirez@gmail.com>2018-07-02 18:46:56 +0200
committerGitHub <noreply@github.com>2018-07-02 18:46:56 +0200
commitbc6a004588dafc14165bbd8851ed9d10fff3295a (patch)
tree1fcecd8e37b35630897e7b1d5909d559934b1c89 /src/debug.c
parentee09b5ed3adccd9914bc7737ecdbe27b275b4f38 (diff)
parent6b675b95252e7d7bbd3bc78d23e4a244a0310b4c (diff)
downloadredis-bc6a004588dafc14165bbd8851ed9d10fff3295a.tar.gz
Merge pull request #4998 from itamarhaber/module_command_help
Module command help
Diffstat (limited to 'src/debug.c')
-rw-r--r--src/debug.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/src/debug.c b/src/debug.c
index b8d0690e2..37f95143f 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -285,26 +285,26 @@ void computeDatasetDigest(unsigned char *final) {
void debugCommand(client *c) {
if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"help")) {
const char *help[] = {
-"assert -- Crash by assertion failed.",
-"change-repl-id -- Change the replication IDs of the instance. Dangerous, should be used only for testing the replication subsystem.",
-"crash-and-recover <milliseconds> -- Hard crash and restart after <milliseconds> delay.",
-"digest -- Outputs an hex signature representing the current DB content.",
-"htstats <dbid> -- Return hash table statistics of the specified Redis database.",
-"htstats-key <key> -- Like htstats but for the hash table stored as key's value.",
-"loadaof -- Flush the AOF buffers on disk and reload the AOF in memory.",
-"lua-always-replicate-commands (0|1) -- Setting it to 1 makes Lua replication defaulting to replicating single commands, without the script having to enable effects replication.",
-"object <key> -- Show low level info about key and associated value.",
-"panic -- Crash the server simulating a panic.",
-"populate <count> [prefix] [size] -- Create <count> string keys named key:<num>. If a prefix is specified is used instead of the 'key' prefix.",
-"reload -- Save the RDB on disk and reload it back in memory.",
-"restart -- Graceful restart: save config, db, restart.",
-"sdslen <key> -- Show low level SDS string info representing key and value.",
-"segfault -- Crash the server with sigsegv.",
-"set-active-expire (0|1) -- Setting it to 0 disables expiring keys in background when they are not accessed (otherwise the Redis behavior). Setting it to 1 reenables back the default.",
-"sleep <seconds> -- Stop the server for <seconds>. Decimals allowed.",
-"structsize -- Return the size of different Redis core C structures.",
-"ziplist <key> -- Show low level info about the ziplist encoding.",
-"error <string> -- Return a Redis protocol error with <string> as message. Useful for clients unit tests to simulate Redis errors.",
+"ASSERT -- Crash by assertion failed.",
+"CHANGE-REPL-ID -- Change the replication IDs of the instance. Dangerous, should be used only for testing the replication subsystem.",
+"CRASH-AND-RECOVER <milliseconds> -- Hard crash and restart after <milliseconds> delay.",
+"DIGEST -- Output a hex signature representing the current DB content.",
+"ERROR <string> -- Return a Redis protocol error with <string> as message. Useful for clients unit tests to simulate Redis errors.",
+"HTSTATS <dbid> -- Return hash table statistics of the specified Redis database.",
+"HTSTATS-KEY <key> -- Like htstats but for the hash table stored as key's value.",
+"LOADAOF -- Flush the AOF buffers on disk and reload the AOF in memory.",
+"LUA-ALWAYS-REPLICATE-COMMANDS <0|1> -- Setting it to 1 makes Lua replication defaulting to replicating single commands, without the script having to enable effects replication.",
+"OBJECT <key> -- Show low level info about key and associated value.",
+"PANIC -- Crash the server simulating a panic.",
+"POPULATE <count> [prefix] [size] -- Create <count> string keys named key:<num>. If a prefix is specified is used instead of the 'key' prefix.",
+"RELOAD -- Save the RDB on disk and reload it back in memory.",
+"RESTART -- Graceful restart: save config, db, restart.",
+"SDSLEN <key> -- Show low level SDS string info representing key and value.",
+"SEGFAULT -- Crash the server with sigsegv.",
+"SET-ACTIVE-EXPIRE <0|1> -- Setting it to 0 disables expiring keys in background when they are not accessed (otherwise the Redis behavior). Setting it to 1 reenables back the default.",
+"SLEEP <seconds> -- Stop the server for <seconds>. Decimals allowed.",
+"STRUCTSIZE -- Return the size of different Redis core C structures.",
+"ZIPLIST <key> -- Show low level info about the ziplist encoding.",
NULL
};
addReplyHelp(c, help);
@@ -582,8 +582,7 @@ NULL
clearReplicationId2();
addReply(c,shared.ok);
} else {
- addReplyErrorFormat(c, "Unknown subcommand or wrong number of arguments for '%s'. Try DEBUG HELP",
- (char*)c->argv[1]->ptr);
+ addReplySubSyntaxError(c);
return;
}
}