options.go
This file
Path
table/options.go
30 lines · 1.9 KiB · Go
Last changed by
chore: prepare v2 (#1116)Drew Smirnoffbefore adoption02d6f06
History of this fileTake it
1package table23import (4 "time"56 "charm.land/gum/v2/style"7)89// Options is the customization options for the table command.10type Options struct {11 Separator string `short:"s" help:"Row separator" default:","`12 Columns []string `short:"c" help:"Column names"`13 Widths []int `short:"w" help:"Column widths"`14 Height int `help:"Table height" default:"0"`15 Print bool `short:"p" help:"static print" default:"false"`16 File string `short:"f" help:"file path" default:""`17 Border string `short:"b" help:"border style" default:"rounded" enum:"rounded,thick,normal,hidden,double,none"`18 ShowHelp bool `help:"Show help keybinds" default:"true" negatable:"" env:"GUM_TABLE_SHOW_HELP"`19 HideCount bool `help:"Hide item count on help keybinds" default:"false" negatable:"" env:"GUM_TABLE_HIDE_COUNT"`20 LazyQuotes bool `help:"If LazyQuotes is true, a quote may appear in an unquoted field and a non-doubled quote may appear in a quoted field" default:"false" env:"GUM_TABLE_LAZY_QUOTES"`21 FieldsPerRecord int `help:"Sets the number of expected fields per record" default:"0" env:"GUM_TABLE_FIELDS_PER_RECORD"`2223 BorderStyle style.Styles `embed:"" prefix:"border." envprefix:"GUM_TABLE_BORDER_"`24 CellStyle style.Styles `embed:"" prefix:"cell." envprefix:"GUM_TABLE_CELL_"`25 HeaderStyle style.Styles `embed:"" prefix:"header." envprefix:"GUM_TABLE_HEADER_"`26 SelectedStyle style.Styles `embed:"" prefix:"selected." set:"defaultForeground=212" envprefix:"GUM_TABLE_SELECTED_"`27 ReturnColumn int `short:"r" help:"Which column number should be returned instead of whole row as string. Default=0 returns whole Row" default:"0"`28 Timeout time.Duration `help:"Timeout until choose returns selected element" default:"0s" env:"GUM_TABLE_TIMEOUT"`29 Padding string `help:"Padding" default:"${defaultPadding}" group:"Style Flags" env:"GUM_TABLE_PADDING"`30}