colors: respect NO_COLOR spec

Microfetch will now respect the NO_COLOR environment variable if it has
been passed to the program. The performance overhead of this operation
is almost none. In addition, the main function has been updated to lock
stdout.
This commit is contained in:
raf 2024-12-19 17:20:46 +03:00
commit 065216af7c
No known key found for this signature in database
GPG key ID: EED98D11B85A2819
5 changed files with 99 additions and 42 deletions

View file

@ -14,6 +14,7 @@ path = "src/main.rs"
[dependencies]
nix = { version = "0.29", features = ["fs", "hostname", "feature"] }
color-eyre = { version = "0.6", default-features = false }
lazy_static = "1.5.0"
[dev-dependencies]
criterion = "0.5"