UNPKG

499 BJavaScriptView Raw
1#!/usr/bin/env node
2
3var 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
14cli.parse(null, ['install', 'test', 'edit', 'remove', 'uninstall', 'ls']);
15
16console.log('Command is: ' + cli.command);