diff options
author | antirez <antirez@gmail.com> | 2017-12-06 12:05:11 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2017-12-06 12:05:14 +0100 |
commit | 522760fac79536eb68dc5fc70e9166f689eb76dc (patch) | |
tree | 6c52ec43016f715418f4b5a03d05034bc720d955 /src/pubsub.c | |
parent | 482d678e95c4d7e5754691799b04a2ae433a9479 (diff) | |
download | redis-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/pubsub.c')
-rw-r--r-- | src/pubsub.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/pubsub.c b/src/pubsub.c index 8bd6e5d60..d1fffa20a 100644 --- a/src/pubsub.c +++ b/src/pubsub.c @@ -327,10 +327,10 @@ void publishCommand(client *c) { void pubsubCommand(client *c) { if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"help")) { const char *help[] = { - "channels [<pattern>] -- Return the currently active channels matching a pattern (default: all).", - "numpat -- Return number of subscriptions to patterns.", - "numsub [channel-1 .. channel-N] -- Returns the number of subscribers for the specified channels (excluding patterns, default: none).", - NULL +"channels [<pattern>] -- Return the currently active channels matching a pattern (default: all).", +"numpat -- Return number of subscriptions to patterns.", +"numsub [channel-1 .. channel-N] -- Returns the number of subscribers for the specified channels (excluding patterns, default: none).", +NULL }; addReplyHelp(c, help); } else if (!strcasecmp(c->argv[1]->ptr,"channels") && @@ -372,8 +372,7 @@ void pubsubCommand(client *c) { /* PUBSUB NUMPAT */ addReplyLongLong(c,listLength(server.pubsub_patterns)); } else { - addReplyErrorFormat(c, "Unknown subcommand or wrong number of arguments for '%s'. Try PUBSUB help", + addReplyErrorFormat(c, "Unknown subcommand or wrong number of arguments for '%s'. Try PUBSUB HELP", (char*)c->argv[1]->ptr); - return; } } |