diff options
author | Alexander Kramarev <pochemuto@yandex-team.ru> | 2020-03-02 16:18:24 +0300 |
---|---|---|
committer | Mateusz CzapliĆski <czapkofan@gmail.com> | 2020-03-03 10:06:01 +0100 |
commit | eaae0396c0b8776a8bd399f3117bf5d4e2183918 (patch) | |
tree | 8da583c48fabfbe10042e68de03a8f6a5b059a9a | |
parent | e8ddd7840ac5cfe954907e96d3d341fddfb976d0 (diff) |
add --no-colors flag #46
-rw-r--r-- | up.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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) } }, |