Skip to content

feat: add colors to CLI help#1884

Open
joshka wants to merge 1 commit into
eza-community:mainfrom
joshka:joshka/color-help
Open

feat: add colors to CLI help#1884
joshka wants to merge 1 commit into
eza-community:mainfrom
joshka:joshka/color-help

Conversation

@joshka

@joshka joshka commented Jul 21, 2026

Copy link
Copy Markdown
Description

Add Cargo-inspired colors to clap-generated help and diagnostics. Headings use bright green, command-line syntax uses bright cyan, and placeholders use cyan.

Enable clap’s wrap_help feature so long descriptions wrap to the terminal width. Color remains subject to clap/anstream’s automatic terminal detection and NO_COLOR support.

This revisits #444, which proposed colored help before eza used clap. That implementation embedded ANSI escapes directly and did not respect NO_COLOR; the current clap-based approach handles those concerns centrally.

This change does not introduce a command-line flag, so no completion, man page, or README updates are required.

How Has This Been Tested?

Tested on macOS 15.7.7 with rustc and Cargo 1.97.1.

  • cargo fmt --all --check
  • cargo test
  • checked the help output in Ghostty with colors enabled and with NO_COLOR set
  • rendered and visually inspected the complete help output using Betamax

@joshka

joshka commented Jul 21, 2026

Copy link
Copy Markdown
Author
image

Style clap-generated help with Cargo's palette and enable terminal-width
wrapping. Preserve clap's automatic terminal detection so redirected
output and NO_COLOR remain unstyled.
@joshka
joshka force-pushed the joshka/color-help branch from b4f5c21 to 2118a37 Compare July 21, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant