-
-
Notifications
You must be signed in to change notification settings - Fork 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(help): Allow user-provided styled text in StyledStr
#4765
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
epage
force-pushed
the
anstream
branch
5 times, most recently
from
March 17, 2023 01:59
030c008
to
c579c17
Compare
epage
changed the title
feat(help): Respect CLICOLOR, CLICOLOR_FORCE
feat(help): Allow styled text
Mar 17, 2023
epage
changed the title
feat(help): Allow styled text
feat(help): Allow user-provided styled text in Mar 17, 2023
StyledStr
epage
force-pushed
the
anstream
branch
4 times, most recently
from
March 18, 2023 00:21
a9ef604
to
4d2cc9b
Compare
pksunkara
approved these changes
Mar 19, 2023
My current thought for how to roll this out is to do it in two steps
This would make it easier to revert the anstream change if its causing problem as we have fewer behavior guarantees around it. However, since clap is generally used by bins which have committed lockfiles
So maybe we don't need to exercise too much caution and can merge this as-is |
2 tasks
We might have respected `NO_COLOR` before via `termcolor`. See clap-rs#4722
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We are deferring to ANSI escape codes as our external stable API for this. Users can then choose to use
owo-colors
,color-print
, etc as they desire and it will just work thanks toanstream
.anstream
is a wrapper around stdout and stderr that will automatically decide whether toBy using
anstream
, we also respectCLICOLOR
andCLICOLOR_FORCE
. We might have respectedNO_COLOR
before viatermcolor
.I ended up fixing #4431 while at it as I was wanting to debug where the fault was in case it was something to fix in
anstream
See #4722
Fixes #1433
Fixes #3108