diff options
author | Itamar Haber <itamar@redislabs.com> | 2018-06-07 18:34:58 +0300 |
---|---|---|
committer | Itamar Haber <itamar@redislabs.com> | 2018-06-07 18:34:58 +0300 |
commit | 76ad23d012f194efa1acc0f8356d945b07681851 (patch) | |
tree | fa483af47218a6011dc78e2415e10eda46ce2e19 /src/networking.c | |
parent | f847dd3ad8aac54f1f5b2919da3b27155926d343 (diff) | |
download | redis-76ad23d012f194efa1acc0f8356d945b07681851.tar.gz |
Adds MODULE HELP and implements addReplySubSyntaxError
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 00558974e..ac28ba2b8 100644 --- a/src/networking.c +++ b/src/networking.c @@ -560,6 +560,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. */ |