Package Exports
- commander-extras
- commander-extras/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (commander-extras) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Commander-Extras
Extremely small utility which adds additional functionality to the Commander NPM module.
// Using the global prototype mutate method
var commander = require('commander');
var commanderExtras = require('commander-extras');
var program = commander
.option('-v, --verbose', 'Be verbose')
.env('FOO', 'FOO Environment variable desription')
.env('BAR', 'BAR Environment variable desription')
.env('BAZ', 'FOO environment variable desription')
.note('Note one')
.note('Note two')
.note('Note three')
.parse(process.argv)
.opts()// Using the global prototype mutate method
var commander = require('commander');
var commanderExtras = require('commander-extras');
var command = new commander.Command();
var program = commanderExtras(command); // Mutate only our custom command
var program = command
.option('-v, --verbose', 'Be verbose')
.env('FOO', 'FOO Environment variable desription')
.env('BAR', 'BAR Environment variable desription')
.env('BAZ', 'FOO environment variable desription')
.note('Note one')
.note('Note two')
.note('Note three')
.parse(process.argv)
.opts()API
The following API's are added to the existing Commander prototype:
CommanderExtras(Command?)
Take an optional Commander.Command instance and add the custom methods to it.
env(name, description)
Used to define an environment variable.
example(cli, title)
Used to define an example with an optional title.
note(description)
Add an additional note to display at the bottom of the help output.