added quit and exit commands to redis-cli in order to quit the interactive mode

This commit is contained in:
antirez 2010-03-03 14:41:47 +01:00
parent 52d23ddbea
commit 2f4d2242ea

View File

@ -460,6 +460,8 @@ static void repl() {
for (ap = args; (*ap = strsep(&line, " \t")) != NULL;) { for (ap = args; (*ap = strsep(&line, " \t")) != NULL;) {
if (**ap != '\0') { if (**ap != '\0') {
if (argc >= max) break; if (argc >= max) break;
if (strcasecmp(*ap,"quit") == 0 || strcasecmp(*ap,"exit") == 0)
exit(0);
ap++; ap++;
argc++; argc++;
} }