nopt
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -353,2 +353,15 @@ // info about each config option. | ||
// if it's an exact known option, then don't go any further | ||
if (abbrevs[arg] === arg) | ||
return null | ||
// if it's an exact known shortopt, same deal | ||
if (shorthands[arg]) { | ||
// make it an array, if it's a list of words | ||
if (shorthands[arg] && !Array.isArray(shorthands[arg])) | ||
shorthands[arg] = shorthands[arg].split(/\s+/) | ||
return shorthands[arg] | ||
} | ||
// first check to see if this arg is a set of single-char shorthands | ||
@@ -561,2 +574,12 @@ var singles = shorthands.___singles | ||
,{c: "--config", l: "--length"}] | ||
,["--acount bla" | ||
,{"acount":true} | ||
,["bla"] | ||
,{account: Boolean, credentials: Boolean, options: String} | ||
,{a:"--account", c:"--credentials",o:"--options"}] | ||
,["--clear" | ||
,{clear:true} | ||
,[] | ||
,{clear:Boolean,con:Boolean,len:Boolean,exp:Boolean,add:Boolean,rep:Boolean} | ||
,{c:"--con",l:"--len",e:"--exp",a:"--add",r:"--rep"}] | ||
].forEach(function (test) { | ||
@@ -563,0 +586,0 @@ var argv = test[0].split(/\s+/) |
{ | ||
"name": "nopt", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", | ||
@@ -5,0 +5,0 @@ "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)", |
Sorry, the diff of this file is not supported yet
28610
616