-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat: support NO_COLOR
and FORCE_COLOR
env vars
#3979
Conversation
CodSpeed Performance ReportMerging #3979 will not alter performanceComparing Summary
|
Should we add |
I'm fine to merge this regardless of anstream changes. |
b8c4a56
to
2c2fbb7
Compare
2c2fbb7
to
1c451f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@samypr100 - This looks good to me. Ok to merge?
The way I read the examples on those two pages, https://force-color.org/ http://no-color.org/ they both suggest that command line flags that turn on color should have precedence over NO_COLOR. i.e "do getopt(3) and/or config-file parsing to possibly turn color back on" and so on. Not sure if I'm confusing myself, or if there are contradicting specs. |
@bluss They're examples, not the standard. The standard itself (the sentence at the top of the pages) doesn't go into detail on how they are meant to interact with each other. |
Summary
Closes #3955
Adds explicit support to
NO_COLOR
andFORCE_COLOR
via GlobalSettings.The order, per specs is now
NO_COLOR
>FORCE_COLOR
>color
.This PR is a backup plan pending rust-cli/anstyle#192.
Test Plan
Tested all cases locally for now; I didn't see existing tests for GlobalSettings parsing.