Skip to content

fix(help): join wrapped multi-line flag descriptions in getUsage - #9907

Open
anasysuf wants to merge 1 commit into
npm:latestfrom
anasysuf:fix/help-flag-description-truncation
Open

fix(help): join wrapped multi-line flag descriptions in getUsage#9907
anasysuf wants to merge 1 commit into
npm:latestfrom
anasysuf:fix/help-flag-description-truncation

Conversation

@anasysuf

Copy link
Copy Markdown

Description

Fixes an issue where subcommand help outputs (e.g. npm stage publish --help) truncated flag descriptions mid-sentence.

In lib/base-cmd.js, def.description.trim().split('\n')[0] was taking only the very first line of multi-line wrapped descriptions from @npmcli/config. This change joins the lines of the first paragraph with spaces so full sentences are displayed properly.

Fixes #9518

Testing

  • Added unit test in test/lib/base-cmd.js to ensure multi-line wrapped flag descriptions are joined and not truncated.
  • Verified node . stage publish --help renders full descriptions.

@anasysuf
anasysuf requested review from a team as code owners August 21, 2026 15:23
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.

[BUG] staged publish help is truncated

1 participant