Skip to content
Myr

docs

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent ce624fa · Browse files · 2 files+25 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+25 added−3 removed

  • other:+25 added−3 removed

2 files+25 added−3 removed

modified:examples/deploy-3 removed
12 unmodified lines
13 .option('-T, --no-tests', 'ignore test hook')1415program16 .command('setup')17 .description('run remote setup commands')17 .action(function(){18 console.log('setup');19 });2021program22 .command('exec <cmd>')24 .description('run the given remote command')23 .action(function(cmd){24 console.log('exec "%s"', cmd);25 });2627program28 .command('*')31 .description('deploy the given env')29 .action(function(env){30 console.log('deploying "%s"', env);31 });32
3 unmodified lines
modified:lib/commander.js+25 added
281 unmodified lines
282283 return this;284};285286/**287 * Parse `argv`, settings options and invoking commands when defined.288 *289 * @param {Array} argv290 * @return {Command} for chaining291 * @api public292 */293294Command.prototype.parse = function(argv){295 // store raw args296 this.rawArgs = argv;297
10 unmodified lines
308 // process argv309 return this.parseArgs(this.parseOptions(this.normalize(argv)));310};311312/**313 * Normalize `args`, splitting joined small flags. For example314 * the arg "-abc" is equivalent to "-a -b -c".315 *316 * @param {Array} args317 * @return {Array}318 * @api private319 */320321Command.prototype.normalize = function(args){322 var ret = []323 , arg;324
10 unmodified lines
335336 return ret;337};338339/**340 * Parse command `args`.341 *342 * @param {Array} args343 * @return {Command} for chaining344 * @api private345 */346347Command.prototype.parseArgs = function(args){348 var cmds = this.commands349 , len = cmds.length;350
235 unmodified lines