command-line-args
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -1,2 +0,3 @@ | ||
var w = require("wodge"), | ||
var a = require("array-ting"), | ||
o = require("object-ting") | ||
util = require("util"), | ||
@@ -36,4 +37,4 @@ Design = require("nature").Design; | ||
function setOutput(optionName){ | ||
var option = w.findWhere(self._attributes, { name: optionName }) | ||
|| w.findWhere(self._attributes, { alias: optionName }); | ||
var option = a.findWhere(self._attributes, { name: optionName }) | ||
|| a.findWhere(self._attributes, { alias: optionName }); | ||
if (option){ | ||
@@ -45,3 +46,3 @@ if(option.type === Boolean){ | ||
if (typeof option.type === "function" && option.type === Array){ | ||
value = spliceWhile(argv, /^\w+/); | ||
value = a.spliceWhile(argv, /^\w+/); | ||
} else { | ||
@@ -75,3 +76,3 @@ if (isOption(argv[0])){ | ||
if (defaultValues.length > 0){ | ||
var defaultOption = w.findWhere(this._attributes, { defaultOption: true }); | ||
var defaultOption = a.findWhere(this._attributes, { defaultOption: true }); | ||
if (defaultOption){ | ||
@@ -94,3 +95,3 @@ if (defaultOption.type === Array){ | ||
var filter = "return attribute.groups && attribute.groups.indexOf('" + groupName + "') > -1;"; | ||
var optionGroup = w.defined(self.where(filter, model)); | ||
var optionGroup = o.defined(self.where(filter, model)); | ||
output[groupName] = optionGroup; | ||
@@ -100,3 +101,3 @@ }); | ||
} else { | ||
return w.defined(model); | ||
return o.defined(model); | ||
} | ||
@@ -108,8 +109,1 @@ }; | ||
}; | ||
function spliceWhile(array, test){ | ||
for (var i = 0; i < array.length; i++){ | ||
if (!test.test(array[i])) break; | ||
} | ||
return array.splice(0, i); | ||
} |
{ | ||
"name": "command-line-args", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Parse command line options", | ||
@@ -26,5 +26,6 @@ "repository": "https://github.com/75lb/command-line-args.git", | ||
"dependencies": { | ||
"array-ting": "^0.2.0", | ||
"nature": "~0.5", | ||
"wodge": "~0.7" | ||
"object-ting": "^0.1.1" | ||
} | ||
} |
13620
3
399
+ Addedarray-ting@^0.2.0
+ Addedobject-ting@^0.1.1
- Removedwodge@~0.7
- Removedwodge@0.7.0(transitive)