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

Method buildConfirmForm

internal/prompter/huh_prompter.go:164–174  ·  view source on GitHub ↗
(prompt string, defaultValue bool)

Source from the content-addressed store, hash-verified

162}
163
164func (p *huhPrompter) buildConfirmForm(prompt string, defaultValue bool) (*huh.Form, *bool) {
165 result := defaultValue
166 form := p.newForm(
167 huh.NewGroup(
168 huh.NewConfirm().
169 Title(prompt).
170 Value(&result),
171 ),
172 )
173 return form, &result
174}
175
176func (p *huhPrompter) Confirm(prompt string, defaultValue bool) (bool, error) {
177 form, result := p.buildConfirmForm(prompt, defaultValue)

Callers 2

ConfirmMethod · 0.95
TestHuhPrompterConfirmFunction · 0.80

Calls 3

newFormMethod · 0.95
ValueMethod · 0.80
TitleMethod · 0.65

Tested by 1

TestHuhPrompterConfirmFunction · 0.64