args
Advanced tools
Comparing version 2.2.1 to 2.2.2
@@ -178,4 +178,3 @@ 'use strict'; | ||
const fromArgs = this.raw[name]; | ||
if (fromArgs) { | ||
if (typeof fromArgs !== 'undefined') { | ||
value = fromArgs; | ||
@@ -187,3 +186,8 @@ } | ||
for (let name of option.usage) { | ||
let propVal = value || option.defaultValue; | ||
let propVal = value; | ||
if (typeof option.defaultValue !== 'undefined' && typeof propVal !== typeof option.defaultValue) { | ||
propVal = option.defaultValue; | ||
} | ||
let condition = true; | ||
@@ -206,6 +210,4 @@ | ||
// Add option to list if it has a value | ||
if (propVal) { | ||
contents[name] = propVal; | ||
} | ||
// Add option to list | ||
contents[name] = propVal; | ||
} | ||
@@ -212,0 +214,0 @@ |
{ | ||
"name": "args", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"description": "Minimal toolkit for building CLIs", | ||
@@ -66,3 +66,3 @@ "main": "dist/index.js", | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.11.5", | ||
"execa": "^0.5.0", | ||
"execa": "^0.6.0", | ||
"gulp": "^3.9.1", | ||
@@ -69,0 +69,0 @@ "gulp-babel": "^6.1.2", |
@@ -19,6 +19,6 @@ # args | ||
Firstly, you need to install the package (you'll need at least node v6): | ||
Install the package (you'll need at least v6 of [Node](https://nodejs.org/en/)): | ||
```bash | ||
$ npm install --save args | ||
npm install --save args | ||
``` | ||
@@ -181,1 +181,5 @@ | ||
... to [Dmitry Smolin](https://github.com/dimsmol) who donated the package name. If you're looking for the old content (before I've added my stuff) of the package, you can find it [here](https://github.com/dimsmol/args). | ||
## Author | ||
Leo Lamprecht ([@notquiteleo](https://twitter.com/notquiteleo)) |
24271
414
184