Documentation
¶
Overview ¶
Copyright © 2022-2024 Thomas von Dein
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- Variables
- func ColorStringToBGColor(colorname string) color.Color
- func ColorStringToColor(colorname string) color.Color
- func Getversion() string
- type Config
- func (conf *Config) ApplyDefaults()
- func (conf *Config) CheckEnv()
- func (conf *Config) Colors() map[color.Level]map[string]color.Color
- func (conf *Config) DetermineColormode()
- func (conf *Config) ParseConfigfile() error
- func (conf *Config) PrepareFilters() error
- func (conf *Config) PrepareModeFlags(flag Modeflag)
- func (conf *Config) PreparePattern(pattern string) error
- func (conf *Config) PrepareSortFlags(flag Sortmode)
- type Modeflag
- type Settings
- type Sortmode
Constants ¶
const ( Extended = iota + 1 Orgtbl Markdown Shell Yaml CSV ASCII )
used for switching printers
const DefaultSeparator string = `(\s\s+|\t)`
const MAXPARTS = 2
const Version string = "v1.2.1"
Variables ¶
var DefaultConfigfile = os.Getenv("HOME") + "/.config/tablizer/config"
var DefaultLoadPath = os.Getenv("HOME") + "/.config/tablizer/lisp"
var VERSION string // maintained by -x
var ValidHooks []string
valid lisp hooks
Functions ¶
func ColorStringToBGColor ¶ added in v1.1.0
same, for background colors
func ColorStringToColor ¶ added in v1.1.0
translate color string to internal color value
func Getversion ¶
func Getversion() string
main program version generated version string, used by -v contains lib.Version on
main branch, and lib.Version-$branch-$lastcommit-$date on
development branch
Types ¶
type Config ¶
type Config struct { Debug bool NoNumbering bool NoHeaders bool Columns string UseColumns []int Separator string OutputMode int InvertMatch bool Pattern string PatternR *regexp.Regexp UseFuzzySearch bool UseHighlight bool SortMode string SortDescending bool SortByColumn int /* FIXME: make configurable somehow, config file or ENV see https://github.com/gookit/color. */ ColorStyle color.Style HighlightStyle color.Style NoHighlightStyle color.Style HighlightHdrStyle color.Style NoColor bool // special case: we use the config struct to transport the lisp // env trough the program Lisp *zygo.Zlisp // a path containing lisp scripts to be loaded on startup LispLoadPath string // config file, optional Configfile string Settings Settings // used for field filtering Rawfilters []string Filters map[string]*regexp.Regexp }
internal config
func (*Config) ApplyDefaults ¶ added in v1.0.12
func (conf *Config) ApplyDefaults()
func (*Config) DetermineColormode ¶ added in v1.0.12
func (conf *Config) DetermineColormode()
find supported color mode, modifies config based on constants
func (*Config) ParseConfigfile ¶ added in v1.1.0
Parse config file. Ignore if the file doesn't exist but return an error if it exists but fails to read or parse
func (*Config) PrepareFilters ¶ added in v1.2.0
func (*Config) PrepareModeFlags ¶
func (*Config) PreparePattern ¶ added in v1.0.12
func (*Config) PrepareSortFlags ¶
type Settings ¶ added in v1.2.0
type Settings struct { FG string `hcl:"FG"` BG string `hcl:"BG"` HighlightFG string `hcl:"HighlightFG"` HighlightBG string `hcl:"HighlightBG"` NoHighlightFG string `hcl:"NoHighlightFG"` NoHighlightBG string `hcl:"NoHighlightBG"` HighlightHdrFG string `hcl:"HighlightHdrFG"` HighlightHdrBG string `hcl:"HighlightHdrBG"` }
public config, set via config file or using defaults