From eaae0396c0b8776a8bd399f3117bf5d4e2183918 Mon Sep 17 00:00:00 2001 From: Alexander Kramarev Date: Mon, 2 Mar 2020 16:18:24 +0300 Subject: add --no-colors flag #46 --- up.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/up.go b/up.go index be6a877..3ae8bdf 100644 --- a/up.go +++ b/up.go @@ -75,6 +75,7 @@ var ( unsafeMode = pflag.Bool("unsafe-full-throttle", false, "enable mode in which command is executed immediately after any change") outputScript = pflag.StringP("output-script", "o", "", "save the command to specified `file` if Ctrl-X is pressed (default: up.sh)") debugMode = pflag.Bool("debug", false, "debug mode") + noColors = pflag.Bool("no-colors", false, "disable interface colors") ) func main() { @@ -783,6 +784,9 @@ func TuiRegion(tui tcell.Screen, x, y, w, h int) Region { W: w, H: h, SetCell: func(dx, dy int, style tcell.Style, ch rune) { if dx >= 0 && dx < w && dy >= 0 && dy < h { + if *noColors { + style = tcell.StyleDefault + } tui.SetCell(x+dx, y+dy, style, ch) } }, -- cgit v1.2.3