Skip to content

Commit

Permalink
Merge pull request #1192 from badboy/ipv6-rediscli
Browse files Browse the repository at this point in the history
Wrap IPv6 in brackets in the prompt.
  • Loading branch information
antirez committed Jul 12, 2013
2 parents 73ae855 + 1b696dc commit 2ed64e1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/redis-cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ static void cliRefreshPrompt(void) {
len = snprintf(config.prompt,sizeof(config.prompt),"redis %s",
config.hostsocket);
else
len = snprintf(config.prompt,sizeof(config.prompt),"redis %s:%d",
len = snprintf(config.prompt,sizeof(config.prompt),
strchr(config.hostip,':') ? "[%s]:%d" : "%s:%d",
config.hostip, config.hostport);
/* Add [dbnum] if needed */
if (config.dbnum != 0)
Expand Down

0 comments on commit 2ed64e1

Please sign in to comment.