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

Function cliFormatReply

app/redis-6.2.6/src/redis-cli.c:1256–1275  ·  view source on GitHub ↗

Generate reply strings in various output modes */

Source from the content-addressed store, hash-verified

1254
1255/* Generate reply strings in various output modes */
1256static sds cliFormatReply(redisReply *reply, int mode, int verbatim) {
1257 sds out;
1258
1259 if (verbatim) {
1260 out = cliFormatReplyRaw(reply);
1261 } else if (mode == OUTPUT_STANDARD) {
1262 out = cliFormatReplyTTY(reply, "");
1263 } else if (mode == OUTPUT_RAW) {
1264 out = cliFormatReplyRaw(reply);
1265 out = sdscatsds(out, config.cmd_delim);
1266 } else if (mode == OUTPUT_CSV) {
1267 out = cliFormatReplyCSV(reply);
1268 out = sdscatlen(out, "\n", 1);
1269 } else {
1270 fprintf(stderr, "Error: Unknown output encoding %d\n", mode);
1271 exit(1);
1272 }
1273
1274 return out;
1275}
1276
1277/* Output any spontaneous PUSH reply we receive */
1278static void cliPushHandler(void *privdata, void *reply) {

Callers 2

cliPushHandlerFunction · 0.85
cliReadReplyFunction · 0.85

Calls 5

cliFormatReplyRawFunction · 0.85
cliFormatReplyTTYFunction · 0.85
sdscatsdsFunction · 0.85
cliFormatReplyCSVFunction · 0.85
sdscatlenFunction · 0.85

Tested by

no test coverage detected