options.go
This file
Path
filter/options.go
48 lines · 4.3 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 filter23import (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–17why, one step back7)89// Options is the customization options for the filter command.10type Options struct {11 Options []string `arg:"" optional:"" help:"Options to filter."`1213 Indicator string `help:"Character for selection" default:"•" env:"GUM_FILTER_INDICATOR"`14 IndicatorStyle style.Styles `embed:"" prefix:"indicator." set:"defaultForeground=212" envprefix:"GUM_FILTER_INDICATOR_"`15 Limit int `help:"Maximum number of options to pick" default:"1" group:"Selection"`16 NoLimit bool `help:"Pick unlimited number of options (ignores limit)" group:"Selection"`17 SelectIfOne bool `help:"Select the given option if there is only one" group:"Selection"`fix: generated completion invalid for fish shell (#837)Raphael Amorimbefore adoption9705aa3
line 18why, one step back18 Selected []string `help:"Options that should start as selected (selects all if given *)" default:"" env:"GUM_FILTER_SELECTED"`refactor: removing huh as a dep (#742)Carlos Alexandro Beckerbefore adoptione30fc5e
line 19why, one step back19 ShowHelp bool `help:"Show help keybinds" default:"true" negatable:"" env:"GUM_FILTER_SHOW_HELP"`fix(filter): --no-strict not working, also weird behavior (#737)Carlos Alexandro Beckerbefore adoption29250f8
line 20why, one step back20 Strict bool `help:"Only returns if anything matched. Otherwise return Filter" negatable:"" default:"true" group:"Selection"`feat(deps): bump github.com/charmbracelet/bubbletea from 0.27.0 to 1.0.0 (#661)dependabot[bot]before adoption6837ed2
lines 21–24why, one step back21 SelectedPrefix string `help:"Character to indicate selected items (hidden if limit is 1)" default:" ◉ " env:"GUM_FILTER_SELECTED_PREFIX"`22 SelectedPrefixStyle style.Styles `embed:"" prefix:"selected-indicator." set:"defaultForeground=212" envprefix:"GUM_FILTER_SELECTED_PREFIX_"`23 UnselectedPrefix string `help:"Character to indicate unselected items (hidden if limit is 1)" default:" ○ " env:"GUM_FILTER_UNSELECTED_PREFIX"`24 UnselectedPrefixStyle style.Styles `embed:"" prefix:"unselected-prefix." set:"defaultForeground=240" envprefix:"GUM_FILTER_UNSELECTED_PREFIX_"`refactor: removing huh as a dep (#742)Carlos Alexandro Beckerbefore adoptione30fc5e
line 25why, one step back25 HeaderStyle style.Styles `embed:"" prefix:"header." set:"defaultForeground=99" envprefix:"GUM_FILTER_HEADER_"`feat(deps): bump github.com/charmbracelet/bubbletea from 0.27.0 to 1.0.0 (#661)dependabot[bot]before adoption6837ed2
lines 26–37why, one step back26 Header string `help:"Header value" default:"" env:"GUM_FILTER_HEADER"`27 TextStyle style.Styles `embed:"" prefix:"text." envprefix:"GUM_FILTER_TEXT_"`28 CursorTextStyle style.Styles `embed:"" prefix:"cursor-text." envprefix:"GUM_FILTER_CURSOR_TEXT_"`29 MatchStyle style.Styles `embed:"" prefix:"match." set:"defaultForeground=212" envprefix:"GUM_FILTER_MATCH_"`30 Placeholder string `help:"Placeholder value" default:"Filter..." env:"GUM_FILTER_PLACEHOLDER"`31 Prompt string `help:"Prompt to display" default:"> " env:"GUM_FILTER_PROMPT"`32 PromptStyle style.Styles `embed:"" prefix:"prompt." set:"defaultForeground=240" envprefix:"GUM_FILTER_PROMPT_"`33 PlaceholderStyle style.Styles `embed:"" prefix:"placeholder." set:"defaultForeground=240" envprefix:"GUM_FILTER_PLACEHOLDER_"`34 Width int `help:"Input width" default:"0" env:"GUM_FILTER_WIDTH"`35 Height int `help:"Input height" default:"0" env:"GUM_FILTER_HEIGHT"`36 Value string `help:"Initial filter value" default:"" env:"GUM_FILTER_VALUE"`37 Reverse bool `help:"Display from the bottom of the screen" env:"GUM_FILTER_REVERSE"`fix: clarify filter --sort flag (#738)Carlos Alexandro Beckerbefore adoptionc422e76
lines 38–39why, one step back38 Fuzzy bool `help:"Enable fuzzy matching; otherwise match from start of word" default:"true" env:"GUM_FILTER_FUZZY" negatable:""`39 FuzzySort bool `help:"Sort fuzzy results by their scores" default:"true" env:"GUM_FILTER_FUZZY_SORT" negatable:""`fix(choose,confirm,file,filter,input,pager,spin): timeout default unit (#724)Carlos Alexandro Beckerbefore adoption098d09a
line 40why, one step back40 Timeout time.Duration `help:"Timeout until filter command aborts" default:"0s" env:"GUM_FILTER_TIMEOUT"`feat(choose,filter): --input-delimiter --output-delimiter (#779)Carlos Alexandro Beckerbefore adoption6d405c4
lines 41–42why, one step back41 InputDelimiter string `help:"Option delimiter when reading from STDIN" default:"\n" env:"GUM_FILTER_INPUT_DELIMITER"`42 OutputDelimiter string `help:"Option delimiter when writing to STDOUT" default:"\n" env:"GUM_FILTER_OUTPUT_DELIMITER"`feat: --no-strip-ansi (#784)Carlos Alexandro Beckerbefore adoption4cedf9f
line 43why, one step back43 StripANSI bool `help:"Strip ANSI sequences when reading from STDIN" default:"true" negatable:"" env:"GUM_FILTER_STRIP_ANSI"`feat: adding --padding to most commands (#960)Carlos Alexandro Beckerbefore adoption6045525
line 44why, one step back44 Padding string `help:"Padding" default:"${defaultPadding}" group:"Style Flags" env:"GUM_FILTER_PADDING"`fix: clarify filter --sort flag (#738)Carlos Alexandro Beckerbefore adoptionc422e76
lines 45–47why, one step back4546 // Deprecated: use [FuzzySort]. This will be removed at some point.47 Sort bool `help:"Sort fuzzy results by their scores" default:"true" env:"GUM_FILTER_FUZZY_SORT" negatable:"" hidden:""`feat(deps): bump github.com/charmbracelet/bubbletea from 0.27.0 to 1.0.0 (#661)dependabot[bot]before adoption6837ed2
line 48why, one step back48}