mirror of
https://github.com/fluencelabs/redis
synced 2025-03-30 22:31:03 +00:00
redis-cli now runs in interactive mode if no command is provided
This commit is contained in:
parent
520b5a33ae
commit
d239ec5960
@ -420,7 +420,7 @@ static void usage() {
|
|||||||
fprintf(stderr, "example: cat /etc/passwd | redis-cli set my_passwd\n");
|
fprintf(stderr, "example: cat /etc/passwd | redis-cli set my_passwd\n");
|
||||||
fprintf(stderr, "example: redis-cli get my_passwd\n");
|
fprintf(stderr, "example: redis-cli get my_passwd\n");
|
||||||
fprintf(stderr, "example: redis-cli -r 100 lpush mylist x\n");
|
fprintf(stderr, "example: redis-cli -r 100 lpush mylist x\n");
|
||||||
fprintf(stderr, "\nRun in interactive mode: redis-cli -i \n");
|
fprintf(stderr, "\nRun in interactive mode: redis-cli -i or just don't pass any command\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -486,12 +486,10 @@ int main(int argc, char **argv) {
|
|||||||
config.interactive = 0;
|
config.interactive = 0;
|
||||||
|
|
||||||
firstarg = parseOptions(argc,argv);
|
firstarg = parseOptions(argc,argv);
|
||||||
|
|
||||||
argc -= firstarg;
|
argc -= firstarg;
|
||||||
argv += firstarg;
|
argv += firstarg;
|
||||||
|
|
||||||
if (config.interactive == 1) repl();
|
if (argc == 0 || config.interactive == 1) repl();
|
||||||
if (argc < 1) usage();
|
|
||||||
|
|
||||||
argvcopy = convertToSds(argc, argv);
|
argvcopy = convertToSds(argc, argv);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user