Method
buildConfirmForm
(prompt string, defaultValue bool)
Source from the content-addressed store, hash-verified
| 162 | } |
| 163 | |
| 164 | func (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 | |
| 176 | func (p *huhPrompter) Confirm(prompt string, defaultValue bool) (bool, error) { |
| 177 | form, result := p.buildConfirmForm(prompt, defaultValue) |