Package Exports
- command-line-commands
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 (command-line-commands) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
documentation in progress
command-line-commands
Add a git-like command interface to your app.
Example
const commandLineCommands = require('command-line-commands')
const cli = commandLineCommands([
{ name: 'help' },
{ name: 'run', definitions: [ { name: 'why', type: String } ] }
])
const command = cli.parse()
switch (command.name) {
case 'help':
console.log("I can't help you.")
break
case 'run':
console.log(`${command.options.why}: this is not a good reason.`)
break
default:
console.log('Unknown command.')
}
CommandLineCommands ⏏
new CommandLineCommands(commands)
Param | Type |
---|---|
commands | array |
commandLineCommands.parse([argv]) ⇒ object
Kind: instance method of CommandLineCommands
Param | Type |
---|---|
[argv] | array |
© 2015 Lloyd Brookes <75pound@gmail.com>. Documented by jsdoc-to-markdown.