mirror of
https://github.com/charmbracelet/gum
synced 2024-06-26 17:20:16 +02:00
66993d8ef1
* chore: add linter configs & workflows * fix: ignore certain linter warnings * fix: mark errors as intentionally ignored * fix: avoid unnecessary conversion * fix: handle template/renderer errors * fix: mark intentionally unused code
21 lines
1.3 KiB
Go
21 lines
1.3 KiB
Go
package choose
|
|
|
|
import "github.com/charmbracelet/gum/style"
|
|
|
|
// Options is the customization options for the choose command.
|
|
// nolint:staticcheck
|
|
type Options struct {
|
|
Options []string `arg:"" optional:"" help:"Options to choose from."`
|
|
|
|
Limit int `help:"Maximum number of options to pick" default:"1" group:"Selection"`
|
|
NoLimit bool `help:"Pick unlimited number of options (ignores limit)" group:"Selection"`
|
|
Height int `help:"Height of the list" default:"10"`
|
|
Cursor string `help:"Prefix to show on item that corresponds to the cursor position" default:"> "`
|
|
CursorPrefix string `help:"Prefix to show on the cursor item (hidden if limit is 1)" default:"[•] "`
|
|
SelectedPrefix string `help:"Prefix to show on selected items (hidden if limit is 1)" default:"[✕] "`
|
|
UnselectedPrefix string `help:"Prefix to show on selected items (hidden if limit is 1)" default:"[ ] "`
|
|
CursorStyle style.Styles `embed:"" prefix:"cursor." set:"defaultForeground=212" set:"name=indicator"`
|
|
ItemStyle style.Styles `embed:"" prefix:"item." hidden:"" set:"defaultForeground=255" set:"name=item"`
|
|
SelectedItemStyle style.Styles `embed:"" prefix:"selected." set:"defaultForeground=212" set:"name=selected item"`
|
|
}
|