Skip to content

Commit 49e44e5

Browse files
Environment variable REDISCLI_AUTH to VALKEYCLI_AUTH conversion (#1995)
Signed-off-by: Hiranmoy Das Chowdhury <hiranmoy.das70@gmail.com>
1 parent 2fe08f8 commit 49e44e5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/valkey-cli.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@
8484
#define CLI_HISTFILE_DEFAULT ".valkeycli_history"
8585
#define CLI_RCFILE_ENV "REDISCLI_RCFILE"
8686
#define CLI_RCFILE_DEFAULT ".valkeyclirc"
87-
#define CLI_AUTH_ENV "REDISCLI_AUTH"
87+
#define CLI_AUTH_ENV "VALKEYCLI_AUTH"
88+
#define OLD_CLI_AUTH_ENV "REDISCLI_AUTH"
8889
#define CLI_CLUSTER_YES_ENV "REDISCLI_CLUSTER_YES"
8990

9091
#define CLUSTER_MANAGER_SLOTS 16384
@@ -2907,6 +2908,9 @@ static int parseOptions(int argc, char **argv) {
29072908
static void parseEnv(void) {
29082909
/* Set auth from env, but do not overwrite CLI arguments if passed */
29092910
char *auth = getenv(CLI_AUTH_ENV);
2911+
if (auth != NULL) {
2912+
auth = getenv(OLD_CLI_AUTH_ENV);
2913+
}
29102914
if (auth != NULL && config.conn_info.auth == NULL) {
29112915
config.conn_info.auth = auth;
29122916
}

0 commit comments

Comments
 (0)