|
35 | 35 | output = flag.String("output", "", "output fields: "+strings.Join(columnIDs(), ", "))
|
36 | 36 | sortBy = flag.String("sort", "mountpoint", "sort output by: "+strings.Join(columnIDs(), ", "))
|
37 | 37 | width = flag.Uint("width", 0, "max output width")
|
38 |
| - themeOpt = flag.String("theme", defaultThemeName(), "color themes: dark, light") |
| 38 | + themeOpt = flag.String("theme", defaultThemeName(), "color themes: dark, light, ansi") |
39 | 39 | styleOpt = flag.String("style", defaultStyleName(), "style: unicode, ascii")
|
40 | 40 |
|
41 | 41 | availThreshold = flag.String("avail-threshold", "10G,1G", "specifies the coloring threshold (yellow, red) of the avail column, must be integer with optional SI prefixes")
|
@@ -180,6 +180,14 @@ func main() {
|
180 | 180 | fmt.Fprintln(os.Stderr, err)
|
181 | 181 | os.Exit(1)
|
182 | 182 | }
|
| 183 | + if term == termenv.ANSI { |
| 184 | + // enforce ANSI theme for limited color support |
| 185 | + theme, err = loadTheme("ansi") |
| 186 | + if err != nil { |
| 187 | + fmt.Fprintln(os.Stderr, err) |
| 188 | + os.Exit(1) |
| 189 | + } |
| 190 | + } |
183 | 191 |
|
184 | 192 | // validate style
|
185 | 193 | style, err := parseStyle(*styleOpt)
|
|
0 commit comments