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

Function confirmWithYes

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

Source from the content-addressed store, hash-verified

2012}
2013
2014static int confirmWithYes(char *msg, int ignore_force) {
2015 /* if --cluster-yes option is set and ignore_force is false,
2016 * do not prompt for an answer */
2017 if (!ignore_force &&
2018 (config.cluster_manager_command.flags & CLUSTER_MANAGER_CMD_FLAG_YES)) {
2019 return 1;
2020 }
2021
2022 printf("%s (type 'yes' to accept): ", msg);
2023 fflush(stdout);
2024 char buf[4];
2025 int nread = read(fileno(stdin),buf,4);
2026 buf[3] = '\0';
2027 return (nread != 0 && !strcmp("yes", buf));
2028}
2029
2030/* Create an sds array from argv, either as-is or by dequoting every
2031 * element. When quoted is non-zero, may return a NULL to indicate an

Callers 2

Calls 3

strcmpFunction · 0.85
readFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected