Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
0e910939
Unverified
Commit
0e910939
authored
Mar 12, 2019
by
Salvatore Sanfilippo
Committed by
GitHub
Mar 12, 2019
Browse files
Merge pull request #5879 from meierfra-ergon/redis-cli-assume-yes
added 'assume-yes' option to redis-cli
parents
67452e91
bc6c1c40
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-cli.c
View file @
0e910939
...
...
@@ -68,6 +68,7 @@
#define REDIS_CLI_RCFILE_ENV "REDISCLI_RCFILE"
#define REDIS_CLI_RCFILE_DEFAULT ".redisclirc"
#define REDIS_CLI_AUTH_ENV "REDISCLI_AUTH"
#define REDIS_CLI_CLUSTER_YES_ENV "REDISCLI_CLUSTER_YES"
#define CLUSTER_MANAGER_SLOTS 16384
#define CLUSTER_MANAGER_MIGRATE_TIMEOUT 60000
...
...
@@ -1438,6 +1439,11 @@ static void parseEnv() {
if
(
auth
!=
NULL
&&
config
.
auth
==
NULL
)
{
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
)
{
...
...
@@ -1549,6 +1555,9 @@ static void usage(void) {
}
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
);
fflush
(
stdout
);
char
buf
[
4
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment