mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
redis-cli: really connect to the right server.
I recently introduced populating the autocomplete help array with the COMMAND command if available. However this was performed before parsing the arguments, defaulting to instance 6379. After the connection is performed it remains stable. The effect is that if there is an instance running on port 6339, whatever port you specify is ignored and 6379 is connected to instead. The right port will be selected only after a reconnection. Close #3314.
This commit is contained in:
parent
a3f893b800
commit
7c8f275a24
@ -2591,13 +2591,16 @@ int main(int argc, char **argv) {
|
||||
else
|
||||
config.output = OUTPUT_STANDARD;
|
||||
config.mb_delim = sdsnew("\n");
|
||||
cliInitHelp();
|
||||
cliIntegrateHelp();
|
||||
|
||||
firstarg = parseOptions(argc,argv);
|
||||
argc -= firstarg;
|
||||
argv += firstarg;
|
||||
|
||||
/* Initialize the help and, if possible, use the COMMAND command in order
|
||||
* to retrieve missing entries. */
|
||||
cliInitHelp();
|
||||
cliIntegrateHelp();
|
||||
|
||||
/* Latency mode */
|
||||
if (config.latency_mode) {
|
||||
if (cliConnect(0) == REDIS_ERR) exit(1);
|
||||
|
Loading…
Reference in New Issue
Block a user