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

Method ConfirmDeletion

internal/prompter/prompter.go:269–284  ·  view source on GitHub ↗
(requiredValue string)

Source from the content-addressed store, hash-verified

267}
268
269func (p *accessiblePrompter) ConfirmDeletion(requiredValue string) error {
270 form := p.newForm(
271 huh.NewGroup(
272 huh.NewInput().
273 Title(fmt.Sprintf("Type %q to confirm deletion", requiredValue)).
274 Validate(func(input string) error {
275 if input != requiredValue {
276 return fmt.Errorf("You entered: %q", input)
277 }
278 return nil
279 }),
280 ),
281 )
282
283 return form.Run()
284}
285
286func (p *accessiblePrompter) InputHostname() (string, error) {
287 var result string

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected