command-line-args
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -47,3 +47,2 @@ 'use strict' | ||
/* walk argv building the output */ | ||
argv.forEach(arg => { | ||
@@ -50,0 +49,0 @@ if (option.isOption(arg)) { |
@@ -35,3 +35,4 @@ 'use strict' | ||
const reBeginsWithValueMarker = new RegExp('^' + option.VALUE_MARKER) | ||
value = reBeginsWithValueMarker.test(value) | ||
const isOptionValueNotationValue = reBeginsWithValueMarker.test(value) | ||
value = isOptionValueNotationValue | ||
? value.replace(reBeginsWithValueMarker, '') | ||
@@ -51,2 +52,8 @@ : value | ||
return true | ||
/* in the case we're setting an --option=value value on a multiple defaultOption, tag the value onto the previous unknown */ | ||
} else if (def.multiple && isOptionValueNotationValue && t.isDefined(this.output[def.name])) { | ||
if (t.isDefined(value) && this.unknown.length) { | ||
this.unknown[this.unknown.length - 1] += `=${value}` | ||
return true | ||
} | ||
} | ||
@@ -58,4 +65,10 @@ } | ||
if (!def) { | ||
if (t.isDefined(optionArg) && this.unknown.indexOf(optionArg) === -1) this.unknown.push(optionArg) | ||
if (t.isDefined(value)) this.unknown.push(value) | ||
if (t.isDefined(optionArg)) this.unknown.push(optionArg) | ||
if (t.isDefined(value)) { | ||
if (isOptionValueNotationValue) { | ||
this.unknown[this.unknown.length - 1] += `=${value}` | ||
} else { | ||
this.unknown.push(value) | ||
} | ||
} | ||
return true | ||
@@ -62,0 +75,0 @@ } |
{ | ||
"name": "command-line-args", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "A mature, feature-complete library to parse command-line options.", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/75lb/command-line-args.git", |
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
80444
1914