1 |
|
2 |
|
3 | var cli = require('cli');
|
4 |
|
5 | //The second (optional) argument of cli.parse() is a command list
|
6 | //Type `./command.js --help` for usage info
|
7 |
|
8 | //cli enables auto-completion of commands (similiar to npm), e.g. all of
|
9 | //the following are equivalent and result in "Command is: install":
|
10 | // $ ./command.js install
|
11 | // $ ./command.js inst
|
12 | // $ ./command.js i
|
13 |
|
14 | cli.parse(null, ['install', 'test', 'edit', 'remove', 'uninstall', 'ls']);
|
15 |
|
16 | console.log('Command is: ' + cli.command);
|