(prompt string, defaultValue bool)
| 220 | } |
| 221 | |
| 222 | func (p *accessiblePrompter) Confirm(prompt string, defaultValue bool) (bool, error) { |
| 223 | result := defaultValue |
| 224 | |
| 225 | if defaultValue { |
| 226 | prompt = p.addDefaultsToPrompt(prompt, []string{"yes"}) |
| 227 | } else { |
| 228 | prompt = p.addDefaultsToPrompt(prompt, []string{"no"}) |
| 229 | } |
| 230 | |
| 231 | form := p.newForm( |
| 232 | huh.NewGroup( |
| 233 | huh.NewConfirm(). |
| 234 | Title(prompt). |
| 235 | Value(&result), |
| 236 | ), |
| 237 | ) |
| 238 | |
| 239 | if err := form.Run(); err != nil { |
| 240 | return false, err |
| 241 | } |
| 242 | return result, nil |
| 243 | } |
| 244 | |
| 245 | func (p *accessiblePrompter) AuthToken() (string, error) { |
| 246 | var result string |
nothing calls this directly
no test coverage detected