MCPcopy Create free account
hub / github.com/F-Stack/f-stack / addReplyHelp

Function addReplyHelp

app/redis-6.2.6/src/networking.c:901–919  ·  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

899 * subcommands in response to the 'help' subcommand. The help array
900 * is terminated by NULL sentinel. */
901void addReplyHelp(client *c, const char **help) {
902 sds cmd = sdsnew((char*) c->argv[0]->ptr);
903 void *blenp = addReplyDeferredLen(c);
904 int blen = 0;
905
906 sdstoupper(cmd);
907 addReplyStatusFormat(c,
908 "%s <subcommand> [<arg> [value] [opt] ...]. Subcommands are:",cmd);
909 sdsfree(cmd);
910
911 while (help[blen]) addReplyStatus(c,help[blen++]);
912
913 addReplyStatus(c,"HELP");
914 addReplyStatus(c," Prints this help.");
915
916 blen += 1; /* Account for the header. */
917 blen += 2; /* Account for the footer. */
918 setDeferredArrayLen(c,blenp,blen);
919}
920
921/* Add a suggestive error reply.
922 * This function is typically invoked by from commands that support

Callers 15

configCommandFunction · 0.85
scriptCommandFunction · 0.85
pubsubCommandFunction · 0.85
sentinelCommandFunction · 0.85
slowlogCommandFunction · 0.85
commandCommandFunction · 0.85
objectCommandFunction · 0.85
memoryCommandFunction · 0.85
clientCommandFunction · 0.85
clusterCommandFunction · 0.85
aclCommandFunction · 0.85
debugCommandFunction · 0.85

Calls 7

sdsnewFunction · 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