MCPcopy Index your code
hub / github.com/cloudfoundry/cli / DisplayTextPrompt

Method DisplayTextPrompt

util/ui/prompt.go:127–137  ·  view source on GitHub ↗

DisplayTextPrompt outputs the prompt and waits for user input.

(template string, templateValues ...map[string]interface{})

Source from the content-addressed store, hash-verified

125
126// DisplayTextPrompt outputs the prompt and waits for user input.
127func (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
139func contains(s []string, v string) bool {
140 for _, x := range s {

Callers

nothing calls this directly

Calls 7

TranslateTextMethod · 0.95
isInterruptFunction · 0.85
NewInteractionMethod · 0.65
SetInMethod · 0.65
SetOutMethod · 0.65
ResolveMethod · 0.65
ExitMethod · 0.65

Tested by

no test coverage detected