commander.js
commander.js copied to clipboard
The root `--help` doesn't respect `.usage()` in a command
Example
.usage('[directory] [options]')
Let me know if I'm missing something here!
On the latest version v12.
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
@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!