book icon indicating copy to clipboard operation
book copied to clipboard

Recommend crate to use for color in the CLI

Open jayvdb opened this issue 1 year ago • 1 comments

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

jayvdb avatar Aug 08 '24 01:08 jayvdb

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 avatar Aug 08 '24 01:08 epage