Ommits from redis-cli's history

This commit is contained in:
Itamar Haber 2019-10-31 15:45:52 +02:00
parent 764b420f5f
commit 9f32d0eed2

View File

@ -1945,8 +1945,12 @@ static void repl(void) {
} }
} }
/* Won't save auth command in history file */ /* Won't save auth or acl setuser commands in history file */
if (!(argv && argc > 0 && !strcasecmp(argv[0+skipargs], "auth"))) { if (!(argv && argc > 0 &&
(!strcasecmp(argv[0+skipargs], "auth") ||
(skipargs + 1 < argc &&
!strcasecmp(argv[0+skipargs], "acl") &&
!strcasecmp(argv[0+skipargs+1], "setuser"))))) {
if (history) linenoiseHistoryAdd(line); if (history) linenoiseHistoryAdd(line);
if (historyfile) linenoiseHistorySave(historyfile); if (historyfile) linenoiseHistorySave(historyfile);
} }