diff options
author | Salvatore Sanfilippo <antirez@gmail.com> | 2018-07-02 18:46:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-02 18:46:56 +0200 |
commit | bc6a004588dafc14165bbd8851ed9d10fff3295a (patch) | |
tree | 1fcecd8e37b35630897e7b1d5909d559934b1c89 /src/networking.c | |
parent | ee09b5ed3adccd9914bc7737ecdbe27b275b4f38 (diff) | |
parent | 6b675b95252e7d7bbd3bc78d23e4a244a0310b4c (diff) | |
download | redis-bc6a004588dafc14165bbd8851ed9d10fff3295a.tar.gz |
Merge pull request #4998 from itamarhaber/module_command_help
Module command help
Diffstat (limited to 'src/networking.c')
-rw-r--r-- | src/networking.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/networking.c b/src/networking.c index b9f17cd73..03214fd99 100644 --- a/src/networking.c +++ b/src/networking.c @@ -562,6 +562,18 @@ void addReplyHelp(client *c, const char **help) { setDeferredMultiBulkLength(c,blenp,blen); } +/* Add a suggestive error reply. + * This function is typically invoked by from commands that support + * subcommands in response to an unknown subcommand or argument error. */ +void addReplySubSyntaxError(client *c) { + sds cmd = sdsnew((char*) c->argv[0]->ptr); + sdstoupper(cmd); + addReplyErrorFormat(c, + "Unknown subcommand or wrong number of arguments for '%s'. Try %s HELP.", + c->argv[1]->ptr,cmd); + sdsfree(cmd); +} + /* Copy 'src' client output buffers into 'dst' client output buffers. * The function takes care of freeing the old output buffers of the * destination client. */ |