Support colored help output - #1328
Open
Zhou-London wants to merge 13 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1328 +/- ##
===========================================
- Coverage 100.00% 99.33% -0.67%
===========================================
Files 17 19 +2
Lines 4546 5243 +697
Branches 0 1121 +1121
===========================================
+ Hits 4546 5208 +662
- Misses 0 35 +35 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
please don't quit this PR, it's so good and helpful |
This file contains hidden or 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
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.
This PR adds support for the colored help output regarding the dicuss in issue: #1285
Functions are added into the
Default Formatter. Whencolor_enabled_is true, ANSI codes are injected into the stream to display various colors.Certain formatting logic has been modified in the colored branch (
color_enabled_ == true):visual_lengthinstead of the actual length, for that the latter one include the ANSI codes, which are not displayed.Macros.hUsage:
app.get_formatter()->enable_color();An example and a new test has been added. Readme has been updated as well. All tests are passed on my x86 Linux (Arch)
machine.