summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kramarev <pochemuto@yandex-team.ru>2020-03-02 16:18:24 +0300
committerMateusz CzapliƄski <czapkofan@gmail.com>2020-03-03 10:06:01 +0100
commiteaae0396c0b8776a8bd399f3117bf5d4e2183918 (patch)
tree8da583c48fabfbe10042e68de03a8f6a5b059a9a
parente8ddd7840ac5cfe954907e96d3d341fddfb976d0 (diff)
add --no-colors flag #46
-rw-r--r--up.go4
1 files changed, 4 insertions, 0 deletions
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<N>.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)
}
},