DisplayOptionalTextPrompt outputs the prompt and waits for user input.
(defaultValue string, template string, templateValues ...map[string]interface{})
| 50 | |
| 51 | // DisplayOptionalTextPrompt outputs the prompt and waits for user input. |
| 52 | func (ui *UI) DisplayOptionalTextPrompt(defaultValue string, template string, templateValues ...map[string]interface{}) (string, error) { |
| 53 | interactivePrompt := ui.Interactor.NewInteraction(ui.TranslateText(template, templateValues...)) |
| 54 | var value = defaultValue |
| 55 | interactivePrompt.SetIn(ui.In) |
| 56 | interactivePrompt.SetOut(ui.OutForInteraction) |
| 57 | err := interactivePrompt.Resolve(&value) |
| 58 | if isInterrupt(err) { |
| 59 | ui.Exiter.Exit(sigIntExitCode) |
| 60 | } |
| 61 | return value, err |
| 62 | } |
| 63 | |
| 64 | // DisplayPasswordPrompt outputs the prompt and waits for user input. Hides |
| 65 | // user's response from the screen. |
nothing calls this directly
no test coverage detected