Skip to content

Commit

Permalink
Add hint for user switch
Browse files Browse the repository at this point in the history
Add hint message to notify the user that with Ctrl+C is possible to
switch the username already choosen
  • Loading branch information
Roberto Ciatti committed Jul 13, 2020
1 parent ec72961 commit da5823c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/asset/installconfig/ovirt/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,17 @@ func (c *clientHTTP) checkURLResponse() error {
// The password provided will be added in the Config struct.
// If an error happens, it will ask again username for users.
func askPassword(c *Config) error {
survey.PasswordQuestionTemplate = `
{{- if .ShowHelp }}{{- color "cyan"}}{{ HelpIcon }} {{ .Help }}{{color "reset"}}{{"\n"}}{{end}}
{{- color "green+hb"}}{{ QuestionIcon }} {{color "reset"}}
{{- color "default+hb"}}{{ .Message }} {{color "reset"}}
{{- if and .Help (not .ShowHelp)}}{{color "cyan"}}[Press Ctrl+C to switch username, {{ HelpInputRune }} for help]{{color "reset"}} {{end}}`

err := survey.Ask([]*survey.Question{
{
Prompt: &survey.Password{
Message: "Engine password",
Help: "",
Help: "Password for the choosen username",
},
Validate: survey.ComposeValidators(survey.Required, authenticated(c)),
},
Expand Down

0 comments on commit da5823c

Please sign in to comment.