command-line-args
Advanced tools
Comparing version 4.0.4 to 4.0.5
@@ -36,5 +36,2 @@ 'use strict' | ||
this.output[def.name].valueSource = 'default' | ||
} else { | ||
/* guarantees a `multiple` returns an array, even without a defaultValue */ | ||
if (def.multiple) this.output[def.name] = new OutputValue([]) | ||
} | ||
@@ -51,2 +48,4 @@ }) | ||
if (def.multiple) outputValue.value = outputValue.value || [] | ||
/* for boolean types, set value to `true`. For all other types run value through setter function. */ | ||
@@ -79,2 +78,4 @@ if (def.isBoolean()) { | ||
if (def.multiple) outputValue.value = outputValue.value || [] | ||
/* run value through setter function. */ | ||
@@ -81,0 +82,0 @@ valueArg.value = def.type(valueArg.value) |
{ | ||
"name": "command-line-args", | ||
"version": "4.0.4", | ||
"version": "4.0.5", | ||
"description": "A mature, feature-complete library to parse command-line options.", | ||
@@ -29,3 +29,3 @@ "repository": "https://github.com/75lb/command-line-args.git", | ||
"devDependencies": { | ||
"coveralls": "^2.13.0", | ||
"coveralls": "^2.13.1", | ||
"jsdoc-to-markdown": "^3.0.0", | ||
@@ -37,4 +37,4 @@ "test-runner": "^0.3.0" | ||
"find-replace": "^1.0.3", | ||
"typical": "^2.6.0" | ||
"typical": "^2.6.1" | ||
} | ||
} |
@@ -1,3 +0,3 @@ | ||
[](https://www.npmjs.org/package/command-line-args) | ||
[](https://www.npmjs.org/package/command-line-args) | ||
[](https://www.npmjs.org/package/command-line-args) | ||
[](https://www.npmjs.org/package/command-line-args) | ||
[](https://travis-ci.org/75lb/command-line-args) | ||
@@ -4,0 +4,0 @@ [](https://coveralls.io/github/75lb/command-line-args?branch=master) |
@@ -56,3 +56,3 @@ 'use strict' | ||
const output = new Output(definitions) | ||
a.deepStrictEqual(output.get('one'), [ ]) | ||
a.deepStrictEqual(output.get('one'), undefined) | ||
output.setOptionValue('--one', '2') | ||
@@ -94,3 +94,3 @@ a.deepStrictEqual(output.get('one'), [ 2 ]) | ||
const output = new Output(definitions) | ||
a.deepStrictEqual(output.get('one'), []) | ||
a.deepStrictEqual(output.get('one'), undefined) | ||
output.setValue('1') | ||
@@ -97,0 +97,0 @@ a.deepStrictEqual(output.get('one'), [ '1' ]) |
@@ -26,9 +26,1 @@ 'use strict' | ||
}) | ||
/* currently not supported, it would complain --yeah is an invalid option */ | ||
runner.skip('type-string: pass a value resembling an option', function () { | ||
a.deepStrictEqual( | ||
commandLineArgs(definitions, { argv: [ '--one', '--yeah' ] }), | ||
{ one: '--yeah' } | ||
) | ||
}) |
Sorry, the diff of this file is not supported yet
88806
42
2170
Updatedtypical@^2.6.1