8 releases (4 breaking)
0.5.2 | Sep 22, 2022 |
---|---|
0.5.1 | Sep 14, 2022 |
0.4.0 | Sep 6, 2022 |
0.3.0 | Sep 5, 2022 |
0.1.0 | Sep 5, 2022 |
#560 in Command-line interface
36 downloads per month
Used in texfmt
21KB
150 lines
should-color
Determine whether output should use colors or not.
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 (requiresclicolor_force
feature),- explicit user preference (for instance command line arguments),
CLICOLOR
environment variable (requiresclicolor
feature),NO_COLOR
environment variable (requiresno_color
feature),- application default choice.
Please refer to the documentation for more details on the resolution process.
Alternatives and comparison
Dependencies
~0.2–7.5MB
~51K SLoC