mirror of
https://codeberg.org/scip/tablizer.git
synced 2026-02-04 10:20:59 +01:00
add output colorization support using regexes
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright © 2022-2025 Thomas von Dein
|
||||
Copyright © 2022-2026 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
|
||||
@@ -95,6 +95,7 @@ func Execute() {
|
||||
conf.PrepareCustomHeaders(headers)
|
||||
|
||||
wrapE(conf.PrepareFilters())
|
||||
wrapE(conf.PrepareColorizers())
|
||||
|
||||
conf.DetermineColormode()
|
||||
conf.ApplyDefaults()
|
||||
@@ -191,6 +192,8 @@ func Execute() {
|
||||
"filter", "F", nil, "Filter by field (field=regexp || field!=regexp)")
|
||||
rootCmd.PersistentFlags().StringArrayVarP(&conf.Transposers,
|
||||
"regex-transposer", "R", nil, "apply /search/replace/ regexp to fields given in -T")
|
||||
rootCmd.PersistentFlags().StringArrayVarP(&conf.Colorizers,
|
||||
"regex-colorizer", "K", nil, "apply /search/color[:background]/ to the whole output")
|
||||
|
||||
// input
|
||||
rootCmd.PersistentFlags().StringVarP(&conf.InputFile, "read-file", "r", "",
|
||||
|
||||
@@ -13,6 +13,7 @@ const shortusage = `tablizer [regex,...] [-r file] [flags]
|
||||
-x col,... use custom headers -d debug
|
||||
-o char use char as output separator -g auto generate headers
|
||||
|
||||
-K /pattern/foreground[:background]/ colorize pattern of output
|
||||
-O org -C CSV -M md -X ext -S shell -Y yaml -J json -P template
|
||||
-a sort by age -i sort numerically -t sort by time -D sort descending order
|
||||
-m show manual -v show version --help show detailed help`
|
||||
|
||||
Reference in New Issue
Block a user