Confirm
result, _ := pterm.DefaultInteractiveConfirm.Show()
pterm.Info.Printfln("You answered: %s", result)
Name | Type | Description |
---|---|---|
DefaultValue | bool | The value that is selected by default and submitted when enter is pressed |
DefaultText | string | Default prompt text |
TextStyle | *Style | Style of the prompt text |
ConfirmText | string | Text that is printed when "y" is pressed (defaults to "yes") |
ConfirmStyle | *Style | Style of the ConfirmText |
RejectText | string | Text that is printed when "n" is pressed (defaults to "no") |
RejectStyle | *Style | Style of the RejectText |
SuffixStyle | *Style | Style of the suffix |
Method | Description |
---|---|
Show(text) | Displays the interactive confirm prompt |
pkg.go.dev contains the full specification for this printer and more technical descriptions.
Last modified 1yr ago