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.
pterm package - github.com/pterm/pterm - Go Packages
Copy link
Edit on GitHub
On this page
Basic Usage
Options
Using Options
Methods
Full Specification