Skip to content

Commit

Permalink
connect: change console title and prompt
Browse files Browse the repository at this point in the history
If a user specifies creds in connect string, use
cleaned up URI for console title and prompt.
  • Loading branch information
psergee committed Oct 24, 2023
1 parent d7e1b4e commit fab4c1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ paths. Default names are changed for PID-files, control sockets and log files.
- Enable logging to file by default for `tarantool` cluster instances.
Default log file name for an instance is `tarantool.log`. `tarantool`'s
stdout/stderr and `tt` logs go to `tt.log` file.
- Remove URI with creds from console title and prompt.

### Added

Expand Down
5 changes: 4 additions & 1 deletion cli/cmd/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ func resolveConnectOpts(cmdCtx *cmdcontext.CmdCtx, cliOpts *config.CliOpts,
connectCtx.Username = user
connectCtx.Password = pass
connOpts = makeConnOpts(network, address, *connectCtx)
connectCtx.ConnectTarget = newURI
} else if isBaseURI(args[0]) {
// Environment variables do not overwrite values.
if connectCtx.Username == "" {
Expand All @@ -282,7 +283,9 @@ func resolveConnectOpts(cmdCtx *cmdcontext.CmdCtx, cliOpts *config.CliOpts,
err = fillErr
return
}
connectCtx.ConnectTarget = args[0]
if connectCtx.ConnectTarget == "" {
connectCtx.ConnectTarget = args[0]
}
return
}

Expand Down

0 comments on commit fab4c1a

Please sign in to comment.