MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / addReplyHelp

Function addReplyHelp

src/networking.cpp:1064–1082  ·  view source on GitHub ↗

Add an array of C strings as status replies with a heading. * This function is typically invoked by from commands that support * subcommands in response to the 'help' subcommand. The help array * is terminated by NULL sentinel. */

Source from the content-addressed store, hash-verified

1062 * subcommands in response to the 'help' subcommand. The help array
1063 * is terminated by NULL sentinel. */
1064void addReplyHelp(client *c, const char **help) {
1065 sds cmd = sdsnew((char*) ptrFromObj(c->argv[0]));
1066 void *blenp = addReplyDeferredLen(c);
1067 int blen = 0;
1068
1069 sdstoupper(cmd);
1070 addReplyStatusFormat(c,
1071 "%s <subcommand> [<arg> [value] [opt] ...]. Subcommands are:",cmd);
1072 sdsfree(cmd);
1073
1074 while (help[blen]) addReplyStatus(c,help[blen++]);
1075
1076 addReplyStatus(c,"HELP");
1077 addReplyStatus(c," Prints this help.");
1078
1079 blen += 1; /* Account for the header. */
1080 blen += 2; /* Account for the footer. */
1081 setDeferredArrayLen(c,blenp,blen);
1082}
1083
1084/* Add a suggestive error reply.
1085 * This function is typically invoked by from commands that support

Callers 15

pubsubCommandFunction · 0.85
latencyCommandFunction · 0.85
clusterCommandFunction · 0.85
objectCommandFunction · 0.85
memoryCommandFunction · 0.85
xgroupCommandFunction · 0.85
xinfoCommandFunction · 0.85
commandCommandFunction · 0.85
debugCommandFunction · 0.85
moduleCommandFunction · 0.85
sentinelCommandFunction · 0.85
configCommandFunction · 0.85

Calls 8

sdsnewFunction · 0.85
ptrFromObjFunction · 0.85
addReplyDeferredLenFunction · 0.85
sdstoupperFunction · 0.85
addReplyStatusFormatFunction · 0.85
sdsfreeFunction · 0.85
addReplyStatusFunction · 0.85
setDeferredArrayLenFunction · 0.85

Tested by

no test coverage detected