MCPcopy Index your code
hub / github.com/cli/cli / Password

Method Password

internal/prompter/prompter.go:201–220  ·  view source on GitHub ↗
(prompt string)

Source from the content-addressed store, hash-verified

199}
200
201func (p *accessiblePrompter) Password(prompt string) (string, error) {
202 var result string
203 // EchoModePassword is not used as password masking is unsupported in huh.
204 // EchoModeNone and EchoModePassword have the same effect of hiding user input.
205 form := p.newForm(
206 huh.NewGroup(
207 huh.NewInput().
208 EchoMode(huh.EchoModeNone).
209 Title(prompt).
210 Value(&result),
211 ),
212 )
213
214 err := form.Run()
215 if err != nil {
216 return "", err
217 }
218
219 return result, nil
220}
221
222func (p *accessiblePrompter) Confirm(prompt string, defaultValue bool) (bool, error) {
223 result := defaultValue

Callers

nothing calls this directly

Calls 4

newFormMethod · 0.95
ValueMethod · 0.80
TitleMethod · 0.65
RunMethod · 0.65

Tested by

no test coverage detected