Skip to content
Myr

options.go

This file

Path

confirm/options.go

25 lines · 1.6 KiB · Go

Last changed by

chore: prepare v2 (#1116)Drew Smirnoffbefore adoption02d6f06

History of this file

Take it

1package confirm23import (4	"time"56	"charm.land/gum/v2/style"7)89// Options is the customization options for the confirm command.10type Options struct {11	Default     bool   `help:"Default confirmation action" default:"true"`12	ShowOutput  bool   `help:"Print prompt and chosen action to output" default:"false"`13	Affirmative string `help:"The title of the affirmative action" default:"Yes"`14	Negative    string `help:"The title of the negative action" default:"No"`15	Prompt      string `arg:"" help:"Prompt to display." default:"Are you sure?"`16	//nolint:staticcheck17	PromptStyle style.Styles `embed:"" prefix:"prompt." help:"The style of the prompt" set:"defaultMargin=0 0 0 1" set:"defaultForeground=#7571F9" set:"defaultBold=true" envprefix:"GUM_CONFIRM_PROMPT_"`18	//nolint:staticcheck19	SelectedStyle style.Styles `embed:"" prefix:"selected." help:"The style of the selected action" set:"defaultBackground=212" set:"defaultForeground=230" set:"defaultPadding=0 3" set:"defaultMargin=0 1" envprefix:"GUM_CONFIRM_SELECTED_"`20	//nolint:staticcheck21	UnselectedStyle style.Styles  `embed:"" prefix:"unselected." help:"The style of the unselected action" set:"defaultBackground=235" set:"defaultForeground=254" set:"defaultPadding=0 3" set:"defaultMargin=0 1" envprefix:"GUM_CONFIRM_UNSELECTED_"`22	ShowHelp        bool          `help:"Show help key binds" negatable:"" default:"true" env:"GUM_CONFIRM_SHOW_HELP"`23	Timeout         time.Duration `help:"Timeout until confirm returns selected value or default if provided" default:"0s" env:"GUM_CONFIRM_TIMEOUT"`24	Padding         string        `help:"Padding" default:"${defaultPadding}" group:"Style Flags" env:"GUM_CONFIRM_PADDING"`25}