Say I wanted to use a different wording for the --version or --help options in the auto-generated help output:
program
.version("0.0.1")
.option("-p, --peppers", "Add peppers")
.option("-P, --pineapple", "Add pineapple")
.option("-c, --cheese", "Add cheese")
.option("-h, --help", "Display this help message and exit")
.option("-V, --version", "Display the version of the running program")
... I can't. Specifying --help prevents the --help option from even doing anything, and specifying --version just duplicates the option in the --help output:
Usage: index [options]
Options:
-h, --help output usage information
-V, --version output the version number
-p, --peppers Add peppers
-P, --pineapple Add pineapple
-c, --cheese Add cheese
-V, --version Display the version of the running program
Shouldn't there be a way of overriding those two option descriptions? Some users might wish to use a different wording, or at least correct the capitalisation.
This is probably never gonna be looked-at, if this package's recent traction is anything to go by.
Have taken it upon myself to develop a simpler and more hands-on alternative instead:
https://www.npmjs.com/package/get-options
Thanks anyway. =) Will leave this open in case somebody does feel like it warrants actioning.
+1
You could always do:
var Command = require('commander').Command;
Command.prototype.helpInformation = function() {
return "My help information!!"
};
/* Do stuff with Command */
Haha, maybe. :D
Too late now, though. Really happy with how this turned out. =)
Duplicate of #471 . Think we'll have to check out your project :-) This is just way too buggy.
This issue has not had any activity in over six months. It isn't likely to get acted on due to this report.
The issue author has done their own approach, and there are other issues covering this area such as #47.
Feel free to open a new issue if it comes up again, with new information and renewed interest.
Thank you for your contributions.
This issue will be resolved when v3.0.0 is released. Available now as a prerelease. See #1001
Support for customising the version and help descriptions has shipped in v3 (thanks @idmontie): https://github.com/tj/commander.js/releases/tag/v3.0.0
Most helpful comment
Support for customising the version and help descriptions has shipped in v3 (thanks @idmontie): https://github.com/tj/commander.js/releases/tag/v3.0.0