cmd/mbf: enable output colouring

This respects the de facto standards, on top of checking stderr.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
cat
2026-07-30 05:16:39 +09:00
parent 6fb2065a51
commit 869820ec6d
3 changed files with 12 additions and 2 deletions
+5
View File
@@ -92,6 +92,11 @@ func main() {
var cm cache
defer func() { cm.Close() }()
if cm.color = ext.Isatty(syscall.Stderr) &&
os.Getenv("NO_COLOR") == "" &&
os.Getenv("TERM") != "dumb"; cm.color {
log.SetPrefix("\x1b[2mmbf: \x1b[0m")
}
var (
flagQuiet bool