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

Method DisplayPasswordPrompt

util/ui/prompt.go:66–79  ·  view source on GitHub ↗

DisplayPasswordPrompt outputs the prompt and waits for user input. Hides user's response from the screen.

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

Source from the content-addressed store, hash-verified

64// DisplayPasswordPrompt outputs the prompt and waits for user input. Hides
65// user's response from the screen.
66func (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.

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