Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommend crate to use for color in the CLI #252

Open
jayvdb opened this issue Aug 8, 2024 · 1 comment
Open

Recommend crate to use for color in the CLI #252

jayvdb opened this issue Aug 8, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@jayvdb
Copy link

jayvdb commented Aug 8, 2024

CLI usually use color to output different log more visually, e.g. red for error.

Choosing a crate which provides this would be a good inclusion to https://github.com/rust-cli/book/blob/master/src/in-depth/human-communication.md

@epage
Copy link
Contributor

epage commented Aug 8, 2024

Agreed that we need to add more guidance around colored output.

I'd recommend using anstream as the basis for it. Because its "good enough" and cheap, I'd then probably use anstyle with it.

(anstream uses anstyle, as well as env_logger and clap so its a "common" dependency)

@epage epage added the documentation Improvements or additions to documentation label Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants