Skip to content

Improve argument coloring where available - #743

Merged
cottsay merged 2 commits into
masterfrom
cottsay/help-colors
Sep 9, 2026
Merged

cottsay merged 2 commits into
masterfrom
cottsay/help-colors

Conversation

@cottsay

@cottsay cottsay commented Aug 17, 2026

Copy link
Copy Markdown
Member
  • Use %(default)s where appropriate
  • Otherwise, use backticks around default values
  • Use backticks when referring to console commands, such as references to other command line options or example command invocations

Example with Python 3.15:
out

Note that we're not actually choosing the palette here, we're just giving argparse the information it needs to align with other console output.

@cottsay cottsay self-assigned this Aug 17, 2026
@cottsay cottsay added the enhancement New feature or request label Aug 17, 2026
* Use %(default)s where appropriate
* Otherwise, use backticks around default values
* Use backticks when referring to console commands, such as references
  to other command line options or example command invocations
@cottsay
cottsay force-pushed the cottsay/help-colors branch from d6b7d9b to 48ed3a0 Compare August 18, 2026 02:44
@codecov

codecov Bot commented Aug 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.60%. Comparing base (6428dca) to head (b2008de).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #743      +/-   ##
==========================================
- Coverage   87.66%   87.60%   -0.07%     
==========================================
  Files          74       75       +1     
  Lines        4442     4581     +139     
  Branches      771      797      +26     
==========================================
+ Hits         3894     4013     +119     
- Misses        433      445      +12     
- Partials      115      123       +8     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cottsay
cottsay requested a review from PiousCrossten August 31, 2026 16:25

@PiousCrossten PiousCrossten left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine, nothing breaks. Ran the tests locally, flake8 and spell check pass, coverage unchanged.

One thing that looks like it slipped through:
verb/test.py:93 and :98 - the --build-base / --install-base args there are identical to the ones in verb/build.py (same wrap_default_value() defaults), but they still say (default: build) / (default: install). So colcon build --help gets the coloring and colcon test --help doesn't.

Rest LGTM 👍

@cottsay

cottsay commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

Ah, well caught @PiousCrossten! I've addressed this in b2008de.

@cottsay
cottsay merged commit 4ee76b1 into master Sep 9, 2026
46 checks passed
@cottsay
cottsay deleted the cottsay/help-colors branch September 9, 2026 19:12
@cottsay cottsay added this to the 0.21.2 milestone Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants