Links

Confirm

Basic Usage

result, _ := pterm.DefaultInteractiveConfirm.Show()
pterm.Info.Printfln("You answered: %s", result)

Options

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

Using Options

Methods

Method
Description
Show(text)
Displays the interactive confirm prompt

Full Specification

pkg.go.dev contains the full specification for this printer and more technical descriptions.