command-line-args
Advanced tools
Comparing version 4.0.2 to 4.0.3
@@ -48,3 +48,3 @@ 'use strict' | ||
/* if it's not a `multiple` and the defaultOption has already been set, move on */ | ||
if (!def.multiple && t.isDefined(this.output[def.name])) { | ||
if (!def.multiple && t.isDefined(this.output[def.name]) && this.output[def.name] !== def.defaultValue) { | ||
if (t.isDefined(value)) this.unknown.push(value) | ||
@@ -51,0 +51,0 @@ return true |
{ | ||
"name": "command-line-args", | ||
"version": "4.0.2", | ||
"version": "4.0.3", | ||
"description": "A mature, feature-complete library to parse command-line options.", | ||
@@ -29,4 +29,4 @@ "repository": "https://github.com/75lb/command-line-args.git", | ||
"devDependencies": { | ||
"coveralls": "^2.11.15", | ||
"jsdoc-to-markdown": "^2.0.1", | ||
"coveralls": "^2.13.0", | ||
"jsdoc-to-markdown": "^3.0.0", | ||
"test-runner": "^0.3.0" | ||
@@ -33,0 +33,0 @@ }, |
@@ -164,3 +164,3 @@ [![view on npm](http://img.shields.io/npm/v/command-line-args.svg)](https://www.npmjs.org/package/command-line-args) | ||
* [.defaultValue](#module_definition--OptionDefinition.OptionDefinition+defaultValue) : <code>\*</code> | ||
* [.group](#module_definition--OptionDefinition.OptionDefinition+group) : <code>string</code> | <code>Array.<string></code> | ||
* [.group](#module_definition--OptionDefinition.OptionDefinition+group) : <code>string</code> \| <code>Array.<string></code> | ||
@@ -309,3 +309,3 @@ <a name="module_definition--OptionDefinition.OptionDefinition+name"></a> | ||
### option.group : <code>string</code> | <code>Array.<string></code> | ||
### option.group : <code>string</code> \| <code>Array.<string></code> | ||
When your app has a large amount of options it makes sense to organise them in groups. | ||
@@ -312,0 +312,0 @@ |
@@ -73,1 +73,20 @@ 'use strict' | ||
}) | ||
runner.test('default value: combined with defaultOption', function () { | ||
const defs = [ | ||
{ name: 'path', defaultOption: true, defaultValue: './' }, | ||
] | ||
let argv = [ '--path', 'test' ] | ||
a.deepStrictEqual(commandLineArgs(defs, { argv }), { | ||
path: 'test' | ||
}) | ||
argv = [ 'test' ] | ||
a.deepStrictEqual(commandLineArgs(defs, { argv }), { | ||
path: 'test' | ||
}) | ||
argv = [ ] | ||
a.deepStrictEqual(commandLineArgs(defs, { argv }), { | ||
path: './' | ||
}) | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80938
1931