should-color

Crates.ioshould-color
lib.rsshould-color
version0.5.2
sourcesrc
created_at2022-09-05 09:57:18.392492
updated_at2022-09-22 12:21:45.08077
descriptionDetermine whether output should use colors or not.
homepage
repositoryhttps://github.com/FedericoStra/should-color
max_upload_size
id658728
size38,145
Federico Stra (FedericoStra)

documentation

README

should-color

Determine whether output should use colors or not.

crates.io docs.rs GitHub GitHub Workflow Status Dependencies status MIT license

The should-color crate helps determine the color choice for an application output based on the command line arguments and environment variables.

The resulting color choice is determined by taking into account, in order of priority from higher to lower, the following settings:

  • CLICOLOR_FORCE environment variable (requires clicolor_force feature),
  • explicit user preference (for instance command line arguments),
  • CLICOLOR environment variable (requires clicolor feature),
  • NO_COLOR environment variable (requires no_color feature),
  • application default choice.

Please refer to the documentation for more details on the resolution process.

Alternatives and comparison

Commit count: 38

cargo fmt