mirror of
https://github.com/charmbracelet/gum
synced 2024-06-07 08:12:17 +02:00
46ddc28ae5
gum choose allows the user to be prompted for a choice from a list of choices. For example, let's ask the user to pick a card from a deck. gum choose --height 15 {Ace,King,Queen,Jack,Ten,Nine,Eight,Seven,Six,Five,Four,Three,Two}" of "{Spades,Hearts,Clubs,Diamonds}
14 lines
614 B
Go
14 lines
614 B
Go
package choose
|
|
|
|
// Options is the customization options for the choose command.
|
|
type Options struct {
|
|
Options []string `arg:"" optional:"" help:"Options to choose from."`
|
|
|
|
Height int `help:"Height of the list." default:"10"`
|
|
HidePagination bool `help:"Hide pagination." default:"false"`
|
|
Indicator string `help:"Prefix to show on selected item" default:"> "`
|
|
IndicatorColor string `help:"Indicator foreground color" default:"212"`
|
|
SelectedColor string `help:"Selected item foreground color" default:"212"`
|
|
UnselectedColor string `help:"Unselected item foreground color" default:""`
|
|
}
|