Socket
Socket
Sign inDemoInstall

command-line-args

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

command-line-args - npm Package Compare versions

Comparing version 4.0.1 to 4.0.2

test/partial.js

1

lib/command-line-args.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc