Commit bc6c1c40 authored by Frank Meier's avatar Frank Meier
Browse files

extend use of cluster-yes option to other confimation questions

parent 44c5bce0
...@@ -68,6 +68,7 @@ ...@@ -68,6 +68,7 @@
#define REDIS_CLI_RCFILE_ENV "REDISCLI_RCFILE" #define REDIS_CLI_RCFILE_ENV "REDISCLI_RCFILE"
#define REDIS_CLI_RCFILE_DEFAULT ".redisclirc" #define REDIS_CLI_RCFILE_DEFAULT ".redisclirc"
#define REDIS_CLI_AUTH_ENV "REDISCLI_AUTH" #define REDIS_CLI_AUTH_ENV "REDISCLI_AUTH"
#define REDIS_CLI_CLUSTER_YES_ENV "REDISCLI_CLUSTER_YES"
#define CLUSTER_MANAGER_SLOTS 16384 #define CLUSTER_MANAGER_SLOTS 16384
#define CLUSTER_MANAGER_MIGRATE_TIMEOUT 60000 #define CLUSTER_MANAGER_MIGRATE_TIMEOUT 60000
...@@ -1430,6 +1431,11 @@ static void parseEnv() { ...@@ -1430,6 +1431,11 @@ static void parseEnv() {
if (auth != NULL && config.auth == NULL) { if (auth != NULL && config.auth == NULL) {
config.auth = auth; config.auth = auth;
} }
char *cluster_yes = getenv(REDIS_CLI_CLUSTER_YES_ENV);
if (cluster_yes != NULL && !strcmp(cluster_yes, "1")) {
config.cluster_manager_command.flags |= CLUSTER_MANAGER_CMD_FLAG_YES;
}
} }
static sds readArgFromStdin(void) { static sds readArgFromStdin(void) {
...@@ -1538,6 +1544,9 @@ static void usage(void) { ...@@ -1538,6 +1544,9 @@ static void usage(void) {
} }
static int confirmWithYes(char *msg) { static int confirmWithYes(char *msg) {
if (config.cluster_manager_command.flags & CLUSTER_MANAGER_CMD_FLAG_YES) {
return 1;
}
printf("%s (type 'yes' to accept): ", msg); printf("%s (type 'yes' to accept): ", msg);
fflush(stdout); fflush(stdout);
char buf[4]; char buf[4];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment