| 199 | } |
| 200 | |
| 201 | func (p *accessiblePrompter) Password(prompt string) (string, error) { |
| 202 | var result string |
| 203 | // EchoModePassword is not used as password masking is unsupported in huh. |
| 204 | // EchoModeNone and EchoModePassword have the same effect of hiding user input. |
| 205 | form := p.newForm( |
| 206 | huh.NewGroup( |
| 207 | huh.NewInput(). |
| 208 | EchoMode(huh.EchoModeNone). |
| 209 | Title(prompt). |
| 210 | Value(&result), |
| 211 | ), |
| 212 | ) |
| 213 | |
| 214 | err := form.Run() |
| 215 | if err != nil { |
| 216 | return "", err |
| 217 | } |
| 218 | |
| 219 | return result, nil |
| 220 | } |
| 221 | |
| 222 | func (p *accessiblePrompter) Confirm(prompt string, defaultValue bool) (bool, error) { |
| 223 | result := defaultValue |