Skip to content

cli: style node --help output with util.styleText#64484

Open
edsadr wants to merge 1 commit into
nodejs:mainfrom
edsadr:help-styling
Open

cli: style node --help output with util.styleText#64484
edsadr wants to merge 1 commit into
nodejs:mainfrom
edsadr:help-styling

Conversation

@edsadr

@edsadr edsadr commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Apply util.styleText to the node --help output for improved visual hierarchy and scannability. Styling is applied only when the output stream supports color (detected via util.styleText's built-in shouldColorize), so piped/redirected output and NO_COLOR remain plain text with no behavior change.

  • Bold: Usage lines, Options:, Environment variables: headers
  • Bold green: CLI option names (e.g. --inspect, -e, --eval)
  • Bold magenta: environment variable names (e.g. NODE_PATH)
  • Dim: "(currently set)" annotation
  • Blue underline: documentation URL

Column-width math uses unstyled string lengths to preserve alignment regardless of styling. The "(currently set)" annotation is styled via post-processing after layout to avoid breaking the fold() width calculation.

Apply util.styleText to the `node --help` output for improved visual
hierarchy and scannability. Styling is applied only when the output
stream supports color (detected via util.styleText's built-in
shouldColorize), so piped/redirected output and NO_COLOR remain plain
text with no behavior change.

- Bold: Usage lines, Options:, Environment variables: headers
- Bold green: CLI option names (e.g. --inspect, -e, --eval)
- Bold magenta: environment variable names (e.g. NODE_PATH)
- Dim: "(currently set)" annotation
- Blue underline: documentation URL

Column-width math uses unstyled string lengths to preserve alignment
regardless of styling. The "(currently set)" annotation is styled via
post-processing after layout to avoid breaking the fold() width
calculation.

Signed-off-by: Adrian Estrada <edsadr@gmail.com>
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Jul 14, 2026

@juanarbol juanarbol left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.23%. Comparing base (ace91de) to head (8f06ce5).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #64484   +/-   ##
=======================================
  Coverage   90.23%   90.23%           
=======================================
  Files         741      741           
  Lines      241681   241703   +22     
  Branches    45547    45551    +4     
=======================================
+ Hits       218075   218103   +28     
- Misses      15141    15155   +14     
+ Partials     8465     8445   -20     
Files with missing lines Coverage Δ
lib/internal/main/print_help.js 100.00% <100.00%> (ø)

... and 32 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@RafaelGSS RafaelGSS added request-ci Add this label to start a Jenkins CI on a PR. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Jul 14, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 14, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants