diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8804f61..4aed93d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -30,7 +30,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: 1.17 + go-version: 1.18 - uses: actions/checkout@v3 - name: golangci-lint uses: golangci/golangci-lint-action@v3 diff --git a/cmd/tablizer.go b/cmd/tablizer.go index 5886c0e..e49dc17 100644 --- a/cmd/tablizer.go +++ b/cmd/tablizer.go @@ -259,6 +259,36 @@ DESCRIPTION and source this file from your PowerShell profile. +CONFIGURATION AND COLORS + YOu can put certain configuration values into a configuration file in + HCL format. By default tablizer looks for + "$HOME/.config/tablizer/config", but you can provide one using the + parameter "-f". + + In the configuration the following variables can be defined: + + BG = "lightGreen" + FG = "white" + HighlightBG = "lightGreen" + HighlightFG = "white" + NoHighlightBG = "white" + NoHighlightFG = "lightGreen" + HighlightHdrBG = "red" + HighlightHdrFG = "white" + + The following color definitions are available: + + black, blue, cyan, darkGray, default, green, lightBlue, lightCyan, + lightGreen, lightMagenta, lightRed, lightWhite, lightYellow, magenta, + red, white, yellow + + The Variables FG and BG are being used to highlight matches. The other + *FG and *BG variables are for colored table output (enabled with the + "-L" parameter). + + Colorization can be turned off completely either by setting the + parameter "-N" or the environment variable NO_COLOR to a true value. + BUGS In order to report a bug, unexpected behavior, feature requests or to submit a patch, please open an issue on github: diff --git a/go.mod b/go.mod index cebaa78..e87a3a8 100644 --- a/go.mod +++ b/go.mod @@ -14,8 +14,6 @@ require ( gopkg.in/yaml.v3 v3.0.1 ) -require github.com/zclconf/go-cty v1.13.2 // indirect - require ( github.com/agext/levenshtein v1.2.1 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect @@ -38,6 +36,7 @@ require ( github.com/tinylib/msgp v1.1.9 // indirect github.com/ugorji/go/codec v1.2.11 // indirect github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect + github.com/zclconf/go-cty v1.13.0 // indirect golang.org/x/sys v0.13.0 // indirect golang.org/x/text v0.11.0 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect diff --git a/go.sum b/go.sum index 6cfa483..79ff9d7 100644 --- a/go.sum +++ b/go.sum @@ -77,8 +77,8 @@ github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZ github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zclconf/go-cty v1.13.2 h1:4GvrUxe/QUDYuJKAav4EYqdM47/kZa672LwmXFmEKT0= -github.com/zclconf/go-cty v1.13.2/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= +github.com/zclconf/go-cty v1.13.0 h1:It5dfKTTZHe9aeppbNOda3mN7Ag7sg6QkBNm6TkyFa0= +github.com/zclconf/go-cty v1.13.0/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= diff --git a/tablizer.1 b/tablizer.1 index c8820a2..2d8285c 100644 --- a/tablizer.1 +++ b/tablizer.1 @@ -446,6 +446,38 @@ To load completions for every new session, run: .Ve .Sp and source this file from your PowerShell profile. +.SH "CONFIGURATION AND COLORS" +.IX Header "CONFIGURATION AND COLORS" +YOu can put certain configuration values into a configuration file in +\&\s-1HCL\s0 format. By default tablizer looks for +\&\f(CW\*(C`$HOME/.config/tablizer/config\*(C'\fR, but you can provide one using the +parameter \f(CW\*(C`\-f\*(C'\fR. +.PP +In the configuration the following variables can be defined: +.PP +.Vb 8 +\& BG = "lightGreen" +\& FG = "white" +\& HighlightBG = "lightGreen" +\& HighlightFG = "white" +\& NoHighlightBG = "white" +\& NoHighlightFG = "lightGreen" +\& HighlightHdrBG = "red" +\& HighlightHdrFG = "white" +.Ve +.PP +The following color definitions are available: +.PP +black, blue, cyan, darkGray, default, green, lightBlue, lightCyan, +lightGreen, lightMagenta, lightRed, lightWhite, lightYellow, +magenta, red, white, yellow +.PP +The Variables \fB\s-1FG\s0\fR and \fB\s-1BG\s0\fR are being used to highlight matches. The +other *FG and *BG variables are for colored table output (enabled with +the \f(CW\*(C`\-L\*(C'\fR parameter). +.PP +Colorization can be turned off completely either by setting the +parameter \f(CW\*(C`\-N\*(C'\fR or the environment variable \fB\s-1NO_COLOR\s0\fR to a true value. .SH "BUGS" .IX Header "BUGS" In order to report a bug, unexpected behavior, feature requests