Skip to content

Conversation

@remorses
Copy link

When running --help on a specific command, shows a Description section with the full command description.

Changes:

  • Show full description in Description section when running command --help
  • Only show first line in commands listing to keep main --help compact

Example:

$ myapp some-command --help

Usage:
  $ myapp some-command

Description:
  Full multi-line description here
  with markdown formatting preserved

Options:
  --id <id>  Node ID

Copilot AI review requested due to automatic review settings January 23, 2026 19:31
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds richer, command-specific help output by introducing a dedicated Description section for subcommands, while keeping the main/global help output compact.

Changes:

  • Add a “Description” section (full, multi-line) for non-global, non-default command --help output.
  • Truncate command descriptions to the first line in the global/default “Commands” listing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +152 to +161
// Show full description for specific commands (not global/default)
if (!this.isGlobalCommand && !this.isDefaultCommand && this.description) {
sections.push({
title: 'Description',
body: this.description
.split('\n')
.map((line) => ` ${line}`)
.join('\n'),
})
}
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

New behavior adds a dedicated "Description" section for subcommand help, but there are no tests asserting this output. Since help output is user-facing and already has coverage (e.g., examples/help.js in src/test/index.test.ts), please add a test (snapshot or string assertions) that verifies some-command --help includes the Description section and preserves multi-line descriptions.

Copilot uses AI. Check for mistakes.
src/Command.ts Outdated
Comment on lines 174 to 179
// Only show first line of description in commands listing
const firstLine = command.description.split('\n')[0].trim()
return ` ${padRight(
command.rawName,
longestCommandName.length
)} ${command.description}`
)} ${firstLine}`
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

The commands listing now truncates descriptions to the first line. Please add/adjust tests to cover this formatting change (e.g., ensure a multi-line command description only shows the first line in the global/default --help output), so future refactors don't regress the compact help behavior.

Copilot uses AI. Check for mistakes.
@remorses remorses force-pushed the feat/help-description-wrap branch from c0e8d20 to 0cdb965 Compare January 23, 2026 20:31
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