mirror of
https://codeberg.org/scip/tablizer.git
synced 2025-12-17 04:30:56 +01:00
added pattern highlighting support
This commit is contained in:
@@ -19,6 +19,7 @@ package lib
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/gookit/color"
|
||||
"io"
|
||||
"os"
|
||||
)
|
||||
@@ -26,6 +27,10 @@ import (
|
||||
func ProcessFiles(args []string) error {
|
||||
fds, pattern, err := determineIO(args)
|
||||
|
||||
if !isTerminal(os.Stdout) {
|
||||
color.Disable()
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -52,6 +57,7 @@ func determineIO(args []string) ([]io.Reader, string, error) {
|
||||
// first one is not a file, consider it as regexp and
|
||||
// shift arg list
|
||||
pattern = args[0]
|
||||
Pattern = args[0] // FIXME
|
||||
args = args[1:]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user