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

dashdash

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dashdash - npm Package Compare versions

Comparing version 1.13.1 to 1.14.0

33

lib/dashdash.js

@@ -1002,2 +1002,34 @@ /**

/**
* Return a synopsis string for the given option spec.
*
* Examples:
* > synopsisFromOpt({names: ['help', 'h'], type: 'bool'});
* '[ --help | -h ]'
* > synopsisFromOpt({name: 'file', type: 'string', helpArg: 'FILE'});
* '[ --file=FILE ]'
*/
function synopsisFromOpt(o) {
assert.object(o, 'o');
if (o.hasOwnProperty('group')) {
return null;
}
var names = o.names || [o.name];
// `type` here could be undefined if, for example, the command has a
// dashdash option spec with a bogus 'type'.
var type = getOptionType(o.type);
var helpArg = o.helpArg || (type && type.helpArg) || 'ARG';
var parts = [];
names.forEach(function (name) {
var part = (name.length === 1 ? '-' : '--') + name;
if (type && type.takesArg) {
part += (name.length === 1 ? ' ' + helpArg : '=' + helpArg);
}
parts.push(part);
});
return ('[ ' + parts.join(' | ') + ' ]');
};
module.exports = {

@@ -1009,2 +1041,3 @@ createParser: createParser,

getOptionType: getOptionType,
synopsisFromOpt: synopsisFromOpt,

@@ -1011,0 +1044,0 @@ // Bash completion-related exports

2

package.json
{
"name": "dashdash",
"description": "A light, featureful and explicit option parsing library.",
"version": "1.13.1",
"version": "1.14.0",
"author": "Trent Mick <trentm@gmail.com> (http://trentm.com)",

@@ -6,0 +6,0 @@ "keywords": ["option", "parser", "parsing", "cli", "command", "args",

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