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
3312de06
Commit
3312de06
authored
May 07, 2018
by
artix
Browse files
Cluster Manager: --cluster options can now be placed everywhere
parent
35b3a8e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-cli.c
View file @
3312de06
...
...
@@ -1293,8 +1293,8 @@ static int parseOptions(int argc, char **argv) {
if (CLUSTER_MANAGER_MODE()) usage();
char *cmd = argv[++i];
int j = i;
for (;
j < argc
; j++) if (
argv[j][0]
=
= '-')
break
;
j--;
while (
j < argc
&&
argv[j][0]
!
= '-')
j++
;
if (j > i)
j--;
createClusterManagerCommand(cmd, j - i, argv + i + 1);
i = j;
} else if (!strcmp(argv[i],"--cluster") && lastarg) {
...
...
@@ -1351,6 +1351,15 @@ static int parseOptions(int argc, char **argv) {
printf("redis-cli %s\n", version);
sdsfree(version);
exit(0);
} else if (CLUSTER_MANAGER_MODE() && argv[i][0] != '-') {
if (config.cluster_manager_command.argc == 0) {
int j = i + 1;
while (j < argc && argv[j][0] != '-') j++;
int cmd_argc = j - i;
config.cluster_manager_command.argc = cmd_argc;
config.cluster_manager_command.argv = argv + i;
if (cmd_argc > 1) i = j - 1;
}
} else {
if (argv[i][0] == '-') {
fprintf(stderr,
...
...
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