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

Method buildAuthTokenForm

internal/prompter/huh_prompter.go:185–202  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

183}
184
185func (p *huhPrompter) buildAuthTokenForm() (*huh.Form, *string) {
186 var result string
187 form := p.newForm(
188 huh.NewGroup(
189 huh.NewInput().
190 EchoMode(huh.EchoModePassword).
191 Title("Paste your authentication token:").
192 Validate(func(input string) error {
193 if input == "" {
194 return fmt.Errorf("token is required")
195 }
196 return nil
197 }).
198 Value(&result),
199 ),
200 )
201 return form, &result
202}
203
204func (p *huhPrompter) AuthToken() (string, error) {
205 form, result := p.buildAuthTokenForm()

Callers 2

AuthTokenMethod · 0.95
TestHuhPrompterAuthTokenFunction · 0.80

Calls 5

newFormMethod · 0.95
ValueMethod · 0.80
ValidateMethod · 0.80
TitleMethod · 0.65
ErrorfMethod · 0.65

Tested by 1

TestHuhPrompterAuthTokenFunction · 0.64