Making our windows friends happy.
Now color is disabled if TERM is not set.
This commit is contained in:
parent
df58715e92
commit
f184474e60
1 changed files with 8 additions and 1 deletions
9
main.go
9
main.go
|
@ -165,7 +165,7 @@ func flagParser(cmdP *cmdParams) {
|
|||
narrow := flag.Bool("narrow", false, "Display weather in narrow view")
|
||||
quiet := flag.Bool("quiet", false, "Add the quiet flag")
|
||||
superQuiet := flag.Bool("super-quiet", false, "Add the super quiet flag")
|
||||
noColors := flag.Bool("no-colors", false, "Disable displaying colors")
|
||||
noColors := flag.Bool("no-colors", false, "Disable displaying colors (always enabled on windows)")
|
||||
addFrame := flag.Bool("add-frame", false, "Add a frame to the output")
|
||||
midTransparency := flag.Bool("mid-transparency", false, "Enable mid-transparency (PNG only)")
|
||||
transparency := flag.Bool("transparency", false, "Enable transparency (PNG only)")
|
||||
|
@ -177,6 +177,13 @@ func flagParser(cmdP *cmdParams) {
|
|||
|
||||
flag.Parse()
|
||||
|
||||
// Windows does not have color encoding
|
||||
// so let's make sure windows users are happy
|
||||
term := os.Getenv("TERM")
|
||||
if term == "" {
|
||||
*noColors = true
|
||||
}
|
||||
|
||||
if *metric {
|
||||
cmdP.Flags += METRIC
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue