commander
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -434,2 +434,3 @@ | ||
, arg | ||
, lastOpt | ||
, index; | ||
@@ -439,3 +440,7 @@ | ||
arg = args[i]; | ||
if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) { | ||
i > 0 && (lastOpt = this.optionFor(args[i-1])); | ||
if (lastOpt && lastOpt.required) { | ||
ret.push(arg); | ||
} else if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) { | ||
arg.slice(1).split('').forEach(function(c){ | ||
@@ -549,3 +554,2 @@ ret.push('-' + c); | ||
if (null == arg) return this.optionMissingArgument(option); | ||
if ('-' == arg[0] && '-' != arg) return this.optionMissingArgument(option, arg); | ||
this.emit(option.name(), arg); | ||
@@ -552,0 +556,0 @@ // optional arg |
{ | ||
"name": "commander" | ||
, "version": "2.0.0" | ||
, "version": "2.1.0" | ||
, "description": "the complete solution for node.js command-line programs" | ||
@@ -12,2 +12,3 @@ , "keywords": ["command", "option", "parser", "prompt", "stdin"] | ||
, "engines": { "node": ">= 0.6.x" } | ||
, "files": ["index.js"] | ||
} |
735
24948
3