yargs / yargs/yargs

Scriptname shows up before each command in `--help`

Open
#1,964 11 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

p2
Dominant language
JavaScript
Stars
11.5k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

This issue is related to: https://github.com/yargs/yargs/issues/1010#issuecomment-856916540

When setting the scriptname, as suggested, it still shows:

example.js <cmd> [args]

Commands:
  example.js hello [name]  welcome ter yargs!

Options:
  --version  Show version number                                       [boolean]
  --help     Show help                                                 [boolean]

But I expect:

example.js <cmd> [args]

Commands:
  hello [name]  welcome ter yargs!     // <- Without the scriptname

Options:
  --version  Show version number                                       [boolean]
  --help     Show help                                                 [boolean]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the help output using a configured script name and compare the usage line with the Commands entries. Trace the yargs help-generation entry point responsible for command formatting. Done means the script name remains in the usage line but is omitted before each command, with the existing command text and options unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.