feat: auto-wrap cli and add colors to the CLI#1842
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the CLI help output by enabling auto-wrapping and adding ANSI color styling via Clap's new wrap_help feature and a custom Styles constant.
- Define
HELP_STYLESwith colored headers, usage, literals, and placeholders - Enable Clap's
"wrap_help"feature and apply the styles in theArgscommand
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| martin/src/args/root.rs | Define HELP_STYLES constant and apply it in the #[command(...)] macro |
| Cargo.toml | Add "wrap_help" feature to the Clap dependency |
Comments suppressed due to low confidence (2)
martin/src/args/root.rs:25
- [nitpick] Rename
HELP_STYLEStoCLI_HELP_STYLES(orHELP_STYLE) to more clearly convey its purpose and follow constant naming clarity.
const HELP_STYLES: Styles = Styles::styled()
martin/src/args/root.rs:36
- No tests currently cover the new auto-wrapping and color styling behavior; consider adding integration tests to verify help output wrapping and ANSI coloring.
styles = HELP_STYLES
nyurik
approved these changes
May 21, 2025
sharkAndshark
approved these changes
May 21, 2025
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.
Motivated by transact-rs/sqlx#3849, this PR brings the same improvemnts here.
The CLIs now autowrap and have a lick of color.
