Skip to content
Myr

expand small flags

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 cd70d2a · Browse files · 2 files+35 added−1 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+35 added−1 removed

  • tests:+15 added−0 removed
  • other:+20 added−1 removed

2 files+35 added−1 removed

modified:lib/commander.js+20 added-1 removed
145 unmodified lines
146 process.exit(0);147 });148149 // process argv150 return this.parseArgs(this.parseOptions(argv));150 return this.parseArgs(this.parseOptions(this.normalize(argv)));151};152153Command.prototype.normalize = function(args){154 var ret = []155 , arg;156157 for (var i = 0, len = args.length; i < len; ++i) {158 arg = args[i];159 if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) {160 arg.slice(1).split('').forEach(function(c){161 ret.push('-' + c);162 });163 } else {164 ret.push(arg);165 }166 }167168 return ret;169};170171172Command.prototype.parseArgs = function(args){173 var cmds = this.commands174 , len = cmds.length;175
163 unmodified lines
added:test/test.options.bool.small.combined.js+15 added