DisplayTextPrompt outputs the prompt and waits for user input.
(template string, templateValues ...map[string]interface{})
| 125 | |
| 126 | // DisplayTextPrompt outputs the prompt and waits for user input. |
| 127 | func (ui *UI) DisplayTextPrompt(template string, templateValues ...map[string]interface{}) (string, error) { |
| 128 | interactivePrompt := ui.Interactor.NewInteraction(ui.TranslateText(template, templateValues...)) |
| 129 | var value string |
| 130 | interactivePrompt.SetIn(ui.In) |
| 131 | interactivePrompt.SetOut(ui.OutForInteraction) |
| 132 | err := interactivePrompt.Resolve(interact.Required(&value)) |
| 133 | if isInterrupt(err) { |
| 134 | ui.Exiter.Exit(sigIntExitCode) |
| 135 | } |
| 136 | return value, err |
| 137 | } |
| 138 | |
| 139 | func contains(s []string, v string) bool { |
| 140 | for _, x := range s { |
nothing calls this directly
no test coverage detected