Documentation ¶
Overview ¶
Package confirm provides an interface to ask a user to confirm an action. The user is provided with an interface to choose an affirmative or negative answer, which is then reflected in the exit code for use in scripting.
If the user selects the affirmative answer, the program exits with 0. If the user selects the negative answer, the program exits with 1.
I.e. confirm if the user wants to delete a file
$ gum confirm "Are you sure?" && rm file.txt
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { Affirmative string `help:"The title of the affirmative action" default:"Yes"` Negative string `help:"The title of the negative action" default:"No"` Default bool `help:"Default confirmation action" default:"true"` Prompt string `arg:"" help:"Prompt to display." default:"Are you sure?"` PromptStyle style.Styles `embed:"" prefix:"prompt." help:"The style of the prompt" set:"defaultMargin=1 0 0 0"` UnselectedStyle style.Styles `` /* 148-byte string literal not displayed */ SelectedStyle style.Styles `` /* 172-byte string literal not displayed */ }
Options is the customization options for the confirm command. nolint:staticcheck
Click to show internal directories.
Click to hide internal directories.