options.go
This file
Path
choose/options.go
35 lines · 2.9 KiB · Go
Last changed by
chore: prepare v2 (#1116)Drew Smirnoffbefore adoption02d6f06
History of this fileTake it
The walk stopped after 200 commits: lines older than 6837ed2 point at it.
feat(deps): bump github.com/charmbracelet/bubbletea from 0.27.0 to 1.0.0 (#661)dependabot[bot]before adoption6837ed2
lines 1–5why, one step back1package choose23import (4 "time"5chore: prepare v2 (#1116)Drew Smirnoffbefore adoption02d6f06
line 6why, one step back6 "charm.land/gum/v2/style"feat(deps): bump github.com/charmbracelet/bubbletea from 0.27.0 to 1.0.0 (#661)dependabot[bot]before adoption6837ed2
lines 7–10why, one step back7)89// Options is the customization options for the choose command.10type Options struct {feat(choose): --selected="*" to select all (#769)Carlos Alexandro Beckerbefore adoption55120ae
lines 11–17why, one step back11 Options []string `arg:"" optional:"" help:"Options to choose from."`12 Limit int `help:"Maximum number of options to pick" default:"1" group:"Selection"`13 NoLimit bool `help:"Pick unlimited number of options (ignores limit)" group:"Selection"`14 Ordered bool `help:"Maintain the order of the selected options" env:"GUM_CHOOSE_ORDERED"`15 Height int `help:"Height of the list" default:"10" env:"GUM_CHOOSE_HEIGHT"`16 Cursor string `help:"Prefix to show on item that corresponds to the cursor position" default:"> " env:"GUM_CHOOSE_CURSOR"`17 ShowHelp bool `help:"Show help keybinds" default:"true" negatable:"" env:"GUM_CHOOSE_SHOW_HELP"`fix(choose): fix typo in environment variable `GUM_CCHOOSE_TIMEOUT` (#922)Sebastian Adamczykbefore adoption501402c
line 18why, one step back18 Timeout time.Duration `help:"Timeout until choose returns selected element" default:"0s" env:"GUM_CHOOSE_TIMEOUT"` // including timeout command options [Timeout,...]feat(choose): --selected="*" to select all (#769)Carlos Alexandro Beckerbefore adoption55120ae
lines 19–22why, one step back19 Header string `help:"Header value" default:"Choose:" env:"GUM_CHOOSE_HEADER"`20 CursorPrefix string `help:"Prefix to show on the cursor item (hidden if limit is 1)" default:"• " env:"GUM_CHOOSE_CURSOR_PREFIX"`21 SelectedPrefix string `help:"Prefix to show on selected items (hidden if limit is 1)" default:"✓ " env:"GUM_CHOOSE_SELECTED_PREFIX"`22 UnselectedPrefix string `help:"Prefix to show on unselected items (hidden if limit is 1)" default:"• " env:"GUM_CHOOSE_UNSELECTED_PREFIX"`fix: generated completion invalid for fish shell (choose/options) (#838)Raphael Amorimbefore adoptionbb098b2
line 23why, one step back23 Selected []string `help:"Options that should start as selected (selects all if given *)" default:"" env:"GUM_CHOOSE_SELECTED"`feat(choose): --selected="*" to select all (#769)Carlos Alexandro Beckerbefore adoption55120ae
line 24why, one step back24 SelectIfOne bool `help:"Select the given option if there is only one" group:"Selection"`feat(choose,filter): --input-delimiter --output-delimiter (#779)Carlos Alexandro Beckerbefore adoption6d405c4
lines 25–26why, one step back25 InputDelimiter string `help:"Option delimiter when reading from STDIN" default:"\n" env:"GUM_CHOOSE_INPUT_DELIMITER"`26 OutputDelimiter string `help:"Option delimiter when writing to STDOUT" default:"\n" env:"GUM_CHOOSE_OUTPUT_DELIMITER"`feat(choose): label delimiters (#783)Carlos Alexandro Beckerbefore adoption2e321f5
line 27why, one step back27 LabelDelimiter string `help:"Allows to set a delimiter, so options can be set as label:value" default:"" env:"GUM_CHOOSE_LABEL_DELIMITER"`feat: --no-strip-ansi (#784)Carlos Alexandro Beckerbefore adoption4cedf9f
line 28why, one step back28 StripANSI bool `help:"Strip ANSI sequences when reading from STDIN" default:"true" negatable:"" env:"GUM_CHOOSE_STRIP_ANSI"`feat: adding --padding to most commands (#960)Carlos Alexandro Beckerbefore adoption6045525
line 29why, one step back29 Padding string `help:"Padding" default:"${defaultPadding}" group:"Style Flags" env:"GUM_CHOOSE_PADDING"`feat(choose): --selected="*" to select all (#769)Carlos Alexandro Beckerbefore adoption55120ae
lines 30–34why, one step back3031 CursorStyle style.Styles `embed:"" prefix:"cursor." set:"defaultForeground=212" envprefix:"GUM_CHOOSE_CURSOR_"`32 HeaderStyle style.Styles `embed:"" prefix:"header." set:"defaultForeground=99" envprefix:"GUM_CHOOSE_HEADER_"`33 ItemStyle style.Styles `embed:"" prefix:"item." hidden:"" envprefix:"GUM_CHOOSE_ITEM_"`34 SelectedItemStyle style.Styles `embed:"" prefix:"selected." set:"defaultForeground=212" envprefix:"GUM_CHOOSE_SELECTED_"`feat(deps): bump github.com/charmbracelet/bubbletea from 0.27.0 to 1.0.0 (#661)dependabot[bot]before adoption6837ed2
line 35why, one step back35}