summaryrefslogtreecommitdiff
path: root/src/slowlog.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2017-12-06 12:05:11 +0100
committerantirez <antirez@gmail.com>2017-12-06 12:05:14 +0100
commit522760fac79536eb68dc5fc70e9166f689eb76dc (patch)
tree6c52ec43016f715418f4b5a03d05034bc720d955 /src/slowlog.c
parent482d678e95c4d7e5754691799b04a2ae433a9479 (diff)
downloadredis-522760fac79536eb68dc5fc70e9166f689eb76dc.tar.gz
Change indentation and other minor details of PR #4489.
The main change introduced by this commit is pretending that help arrays are more text than code, thus indenting them at level 0. This improves readability, and is an old practice when defining arrays of C strings describing text. Additionally a few useless return statements are removed, and the HELP subcommand capitalized when printed to the user.
Diffstat (limited to 'src/slowlog.c')
-rw-r--r--src/slowlog.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/slowlog.c b/src/slowlog.c
index 3003abc42..2613435af 100644
--- a/src/slowlog.c
+++ b/src/slowlog.c
@@ -142,11 +142,12 @@ void slowlogReset(void) {
void slowlogCommand(client *c) {
if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"help")) {
const char *help[] = {
- "get [count] -- Return top entries from the slowlog (default: 10). Entries are made of:",
- " id, timestamp, time in microseconds, arguments array, client IP and port, client name",
- "len -- Return the length of the slowlog.",
- "reset -- Reset the slowlog.",
- NULL
+"get [count] -- Return top entries from the slowlog (default: 10)."
+" Entries are made of:",
+" id, timestamp, time in microseconds, arguments array, client IP and port, client name",
+"len -- Return the length of the slowlog.",
+"reset -- Reset the slowlog.",
+NULL
};
addReplyHelp(c, help);
} else if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"reset")) {
@@ -186,8 +187,6 @@ void slowlogCommand(client *c) {
}
setDeferredMultiBulkLength(c,totentries,sent);
} else {
- addReplyErrorFormat(c, "Unknown subcommand or wrong number of arguments for '%s'. Try SLOWLOG help",
- (char*)c->argv[1]->ptr);
- return;
+ addReplyErrorFormat(c, "Unknown subcommand or wrong number of arguments for '%s'. Try SLOWLOG HELP", (char*)c->argv[1]->ptr);
}
}