enbas/internal/utilities/displayer.go
Dan Anglin bff1eba972
feat: add NO_COLOR support
Add support for disabling ANSI colour output via the --no-color flag
or the NO_COLOR environment variable. The suggested implementation was
inspired by the standards defined at no-color.org
2024-05-31 21:18:11 +01:00

11 lines
186 B
Go

package utilities
import "os"
type Displayer interface {
Display(noColor bool) string
}
func Display(d Displayer, noColor bool) {
os.Stdout.WriteString(d.Display(noColor) + "\n")
}