-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Milestone
Description
Our goal: customize the help message for the root command.
Existing solution won't help, because we need to append the message on top of auto-gen help, and also modify the auto-gen help a little bit.
Context for our cmd app: below is the root cmd, and we have a sub-cmd under the root as well as a git-style-sub-command.
commander
.description('')
.command('sub-cmd')
.command('git-style-sub-cmd')
.version(require('../package.json').version)
.option('-h, --help', 'output help message', () => {
console.log('custom help msg');
})
.parse(process.argv);
In the example I tried using option('-h, --help'), the console.log works for me with my demanded help output. But when I try sub-cmd and git-style-sub-cmd, the help message for the root command is always coming along when I type "cmd sub-cmd --help" and "cmd git-style-sub-cmd --help".
I noticed #242 , where @shadowspawn mentioned it won't be supported. Reopen it as it'd be an important feature for us.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels