DisplayPasswordPrompt outputs the prompt and waits for user input. Hides user's response from the screen.
(template string, templateValues ...map[string]interface{})
| 64 | // DisplayPasswordPrompt outputs the prompt and waits for user input. Hides |
| 65 | // user's response from the screen. |
| 66 | func (ui *UI) DisplayPasswordPrompt(template string, templateValues ...map[string]interface{}) (string, error) { |
| 67 | ui.terminalLock.Lock() |
| 68 | defer ui.terminalLock.Unlock() |
| 69 | |
| 70 | var password interact.Password |
| 71 | interactivePrompt := ui.Interactor.NewInteraction(ui.TranslateText(template, templateValues...)) |
| 72 | interactivePrompt.SetIn(ui.In) |
| 73 | interactivePrompt.SetOut(ui.OutForInteraction) |
| 74 | err := interactivePrompt.Resolve(interact.Required(&password)) |
| 75 | if isInterrupt(err) { |
| 76 | ui.Exiter.Exit(sigIntExitCode) |
| 77 | } |
| 78 | return string(password), err |
| 79 | } |
| 80 | |
| 81 | // DisplayTextMenu lets the user choose from a list of options, either by name |
| 82 | // or by number. |
nothing calls this directly
no test coverage detected