fixed -X output in combination with -c

This commit is contained in:
2022-10-11 09:11:46 +02:00
parent 6ae4a1b6d9
commit b9ed7d8cb7
5 changed files with 49 additions and 16 deletions

View File

@@ -17,6 +17,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package lib
import (
"github.com/gookit/color"
//"github.com/xo/terminfo"
)
var (
// command line flags
Debug bool
@@ -35,11 +40,30 @@ var (
InvertMatch bool
Pattern string
// FIXME: make configurable somehow, config file or ENV
MatchFG string = "black" // see https://github.com/gookit/color
MatchBG string = "green"
/*
FIXME: make configurable somehow, config file or ENV
see https://github.com/gookit/color will be set by
io.ProcessFiles() according to currently supported
color mode.
*/
MatchFG string
MatchBG string
NoColor bool
// colors to be used per supported color mode
Colors = map[color.Level]map[string]string{
color.Level16: map[string]string{
"bg": "green", "fg": "black",
},
color.Level256: map[string]string{
"bg": "lightGreen", "fg": "black",
},
color.LevelRgb: map[string]string{
// FIXME: maybe use something nicer
"bg": "lightGreen", "fg": "black",
},
}
// used for validation
validOutputmodes = "(orgtbl|markdown|extended|ascii)"