Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The root --help doesn't respect .usage() in a command #2148

Open
samcx opened this issue Feb 8, 2024 · 2 comments
Open

The root --help doesn't respect .usage() in a command #2148

samcx opened this issue Feb 8, 2024 · 2 comments

Comments

@samcx
Copy link

samcx commented Feb 8, 2024

Example

.usage('[directory] [options]')

CleanShot 2024-02-07 at 17 39 20@2x

Let me know if I'm missing something here!

On the latest version v12.

@shadowspawn
Copy link
Collaborator

This is historical behaviour (which I am still wondering whether to change).

You can configure the help so the subcommand list displays your custom usage.

Example file: help-subcommands-usage.js

program.configureHelp({ subcommandTerm: (cmd) => cmd.name() + ' ' + cmd.usage() });

Related: #1853 #1885

@samcx
Copy link
Author

samcx commented Feb 9, 2024

@shadowspawn Thank you for the confirmation!

Given how things are nicely updated in the root help output (e.g., description()) when things are updated in a subcommand, I was expecting it to also change for usage(), so maybe it would be a nice change for consistency!

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

No branches or pull requests

2 participants