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 5.0.0-alpha.2 to 5.0.0

snapshot-00000-2018-01-17_17-01-13.765.jpg

4

doc/API.md

@@ -9,3 +9,3 @@ <a name="module_command-line-args"></a>

Parsing is strict by default - an exception is thrown if the user sets an unknown value or option (one without a valid [definition](https://github.com/75lb/command-line-args/blob/next/doc/option-definition.md)). To be more permissive, enabling [partial mode](https://github.com/75lb/command-line-args/wiki/Partial-mode-example) will return known options as usual and return unknown arguments in a separate `_unknown` property.
Parsing is strict by default - an exception is thrown if the user sets an unknown value or option (one without a valid [definition](https://github.com/75lb/command-line-args/blob/master/doc/option-definition.md)). To be more permissive, enabling [partial mode](https://github.com/75lb/command-line-args/wiki/Partial-mode-example) will return known options as usual and return unknown arguments in a separate `_unknown` property.

@@ -30,3 +30,3 @@ **Kind**: Exported function

| --- | --- | --- |
| optionDefinitions | <code>Array.&lt;module:definition&gt;</code> | An array of [OptionDefinition](https://github.com/75lb/command-line-args/blob/next/doc/option-definition.md) objects |
| optionDefinitions | <code>Array.&lt;module:definition&gt;</code> | An array of [OptionDefinition](https://github.com/75lb/command-line-args/blob/master/doc/option-definition.md) objects |
| [options] | <code>object</code> | Options. |

@@ -33,0 +33,0 @@ | [options.argv] | <code>Array.&lt;string&gt;</code> | An array of strings which, if present will be parsed instead of `process.argv`. |

@@ -11,5 +11,5 @@ 'use strict'

*
* Parsing is strict by default - an exception is thrown if the user sets an unknown value or option (one without a valid [definition](https://github.com/75lb/command-line-args/blob/next/doc/option-definition.md)). To be more permissive, enabling [partial mode](https://github.com/75lb/command-line-args/wiki/Partial-mode-example) will return known options as usual and return unknown arguments in a separate `_unknown` property.
* Parsing is strict by default - an exception is thrown if the user sets an unknown value or option (one without a valid [definition](https://github.com/75lb/command-line-args/blob/master/doc/option-definition.md)). To be more permissive, enabling [partial mode](https://github.com/75lb/command-line-args/wiki/Partial-mode-example) will return known options as usual and return unknown arguments in a separate `_unknown` property.
*
* @param {module:definition[]} - An array of [OptionDefinition](https://github.com/75lb/command-line-args/blob/next/doc/option-definition.md) objects
* @param {module:definition[]} - An array of [OptionDefinition](https://github.com/75lb/command-line-args/blob/master/doc/option-definition.md) objects
* @param {object} [options] - Options.

@@ -16,0 +16,0 @@ * @param {string[]} [options.argv] - An array of strings which, if present will be parsed instead of `process.argv`.

{
"name": "command-line-args",
"version": "5.0.0-alpha.2",
"version": "5.0.0",
"description": "A mature, feature-complete library to parse command-line options.",

@@ -31,3 +31,3 @@ "repository": "https://github.com/75lb/command-line-args.git",

"coveralls": "^3.0.0",
"jsdoc-to-markdown": "^3.0.3",
"jsdoc-to-markdown": "^3.0.4",
"test-runner": "^0.5.0-1"

@@ -34,0 +34,0 @@ },

@@ -9,7 +9,7 @@ [![view on npm](https://img.shields.io/npm/v/command-line-args.svg)](https://www.npmjs.org/package/command-line-args)

***Upgraders, please read the [release notes](https://github.com/75lb/command-line-args/releases)***
# command-line-args
A mature, feature-complete library to parse command-line options.
*If your app requires a git-like command interface, consider using [command-line-commands](https://github.com/75lb/command-line-commands).*
## Synopsis

@@ -24,3 +24,3 @@ You can set options using the main notation standards ([learn more](https://github.com/75lb/command-line-args/wiki/Notation-rules)). These commands are all equivalent, setting the same values:

To access the values, first create a list of [option definitions](https://github.com/75lb/command-line-args/blob/next/doc/option-definition.md) describing the options your application accepts. The [`type`](https://github.com/75lb/command-line-args/blob/next/doc/option-definition.md#optiontype--function) property is a setter function (the value supplied is passed through this), giving you full control over the value received.
To access the values, first create a list of [option definitions](https://github.com/75lb/command-line-args/blob/master/doc/option-definition.md) describing the options your application accepts. The [`type`](https://github.com/75lb/command-line-args/blob/master/doc/option-definition.md#optiontype--function) property is a setter function (the value supplied is passed through this), giving you full control over the value received.

@@ -35,3 +35,3 @@ ```js

Next, parse the options using [commandLineArgs()](https://github.com/75lb/command-line-args/blob/next/doc/API.md#commandlineargsoptiondefinitions-options--object-):
Next, parse the options using [commandLineArgs()](https://github.com/75lb/command-line-args/blob/master/doc/API.md#commandlineargsoptiondefinitions-options--object-):
```js

@@ -54,2 +54,18 @@ const commandLineArgs = require('command-line-args')

### Advanced usage
Beside the above typical usage, you can use command-line-args to accept more advanced command line syntax forms.
* [Git-style command syntax](https://github.com/75lb/command-line-args/wiki/Implement-command-parsing-(git-style)), for example:
```
$ git commit --squash -m This is my commit message
```
* [Complex docker-style commands containing multiple commands](https://github.com/75lb/command-line-args/wiki/Implement-multiple-command-parsing-(docker-style)), for example:
```
$ docker run --detached centos bash -c yum install -y httpd
```
## Usage guide generation

@@ -56,0 +72,0 @@

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