cli: style node --help output with util.styleText · nodejs/node@fe8fa45 · GitHub
Skip to content

Commit fe8fa45

Browse files
edsadraduh95
authored andcommitted
cli: style node --help output with util.styleText
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> PR-URL: #64484 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
1 parent e5278b7 commit fe8fa45

2 files changed

Lines changed: 88 additions & 9 deletions

File tree

lib/internal/main/print_help.js

Lines changed: 24 additions & 9 deletions
Lines changed: 64 additions & 0 deletions

0 commit comments

Comments
 (0)