diff options
author | Øyvind Grønnesby <oyving@yahooinc.com> | 2022-03-29 12:35:54 +0200 |
---|---|---|
committer | Øyvind Grønnesby <oyving@yahooinc.com> | 2022-03-29 12:35:54 +0200 |
commit | 0b1f71f8b6827ea8f14bd88980e46681e056c8cf (patch) | |
tree | eff6a4171fe06e52c268207fcc0e5751411e6ee5 /client | |
parent | 4fdab3816bccfcf43d7f8a0d253d8da50b0bbc3e (diff) |
Don't print new line before question and minor fixes
Diffstat (limited to 'client')
-rw-r--r-- | client/go/cmd/login.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/client/go/cmd/login.go b/client/go/cmd/login.go index 4067a2221c9..b5bbdcc2bfa 100644 --- a/client/go/cmd/login.go +++ b/client/go/cmd/login.go @@ -46,7 +46,7 @@ func newLoginCmd(cli *CLI) *cobra.Command { log.Printf("Your Device Confirmation code is: %s\n", state.UserCode) - auto_open := confirm("Allow Vespa CLI to open confirmation page in your default browser?") + auto_open := confirm(cli, "Automatically open confirmation page in your default browser?") if auto_open { log.Printf("Opened link in your browser: %s\n", state.VerificationURI) @@ -95,12 +95,12 @@ func newLoginCmd(cli *CLI) *cobra.Command { } } -func confirm(question string) bool { +func confirm(cli *CLI, question string) bool { for { var answer string - log.Printf("%s [Y/n] ", question) - fmt.Scanln(&answer) + fmt.Fprintf(cli.Stdout, "%s [Y/n] ", question) + fmt.Fscanln(cli.Stdin, &answer) answer = strings.TrimSpace(strings.ToLower(answer)) |