Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

command-line-args

Package Overview
Dependencies
Maintainers
1
Versions
75
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.2 to 4.0.3

2

lib/output.js

@@ -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> &#124; <code>Array.&lt;string&gt;</code>
* [.group](#module_definition--OptionDefinition.OptionDefinition+group) : <code>string</code> \| <code>Array.&lt;string&gt;</code>

@@ -309,3 +309,3 @@ <a name="module_definition--OptionDefinition.OptionDefinition+name"></a>

### option.group : <code>string</code> &#124; <code>Array.&lt;string&gt;</code>
### option.group : <code>string</code> \| <code>Array.&lt;string&gt;</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: './'
})
})
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