-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
How do I implement $ program help command
#205
Comments
our docs just suck, it's called for you when you do |
I tried for a long time to grok what what you are saying, digging through the code (and the errors) and thinking "man, this makes no sense." Until I found this: https://github.com/visionmedia/commander.js/blob/master/examples/pm Put differently I want the two calls below to result in the same output.
Which I finally got working like so: program
.command('help [command]')
.description('Show usage information')
.action(function(cmd) {
'string' === typeof cmd
? program.emit(cmd, null, ['--help'])
: program.outputHelp()
;
}); Yeah, docs could be better. 👊 |
Mmmm ... i really don't get it ... the "help" command does only seem to work when you make use of is there any reason this does not work for the second form other than that it's currently not implemented? |
The two forms supported by default in later versions of Commander are:
|
I looked through the code and docs but don't understand how to get it to work.
There's a reference to this functionality at Command.prototype.addImplicitHelpCommand
But the method is marked as private, yet it's never called anywhere.
Either I just don't get it or this is a bug.
The text was updated successfully, but these errors were encountered: