Socket
Socket
Sign inDemoInstall

cmdln

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.0 to 3.0.1

10

CHANGES.md
# node-cmdln Changelog
## 3.0.1
- Allow one to override how option help is formatted for a subcmd by setting
`CLI.prototype.do_<subcmd>.helpOpts = <dashdash helpOpts object>;`. See
supported helpOpts in [the dashdash help config
docs](https://github.com/trentm/node-dashdash#help-config).
- Update to latest dashdash (1.7.1).
## 3.0.0

@@ -4,0 +14,0 @@

23

lib/cmdln.js

@@ -61,3 +61,22 @@ /*

/**
* Return a new object that is a shallow merge of all the given objects.
* Last one wins. Example:
*
* > objMerge({"a":1,"b":2}, {"b":3,"c":4});
* { a: 1, b: 3, c: 4 }
*/
function objMerge(/* ... */) {
var merged = {};
for (var i = 0; i < arguments.length; i++) {
var obj = arguments[i];
var keys = Object.keys(obj);
for (var k = 0; k < keys.length; k++) {
merged[keys[k]] = obj[keys[k]];
}
}
return merged;
}
// ---- Errors

@@ -511,4 +530,6 @@

var parser = new dashdash.Parser({options: func.options});
var helpOpts = (func.helpOpts
? objMerge(this.helpOpts, func.helpOpts) : this.helpOpts);
help = help.replace('{{options}}',
'Options:\n' + parser.help(this.helpOpts));
'Options:\n' + parser.help(helpOpts));
}

@@ -515,0 +536,0 @@ console.log(help.trimRight());

4

package.json
{
"name": "cmdln",
"version": "3.0.0",
"version": "3.0.1",
"description": "helper lib for creating CLI tools with subcommands; think `git`, `svn`, `zfs`",

@@ -19,3 +19,3 @@ "author": "Trent Mick (http://trentm.com)",

"verror": "1.5.1",
"dashdash": "1.7.0"
"dashdash": "1.7.1"
},

@@ -22,0 +22,0 @@ "devDependencies": {

@@ -168,2 +168,8 @@ `node-cmdln` is a node.js helper lib for creating CLI tools with subcommands

- `CLI.prototype.do_<subcmd>.helpOpts = <dashdash helpOpts object>;` to override
formatting settings for `options` help output for this command. By default
the `helpOpts` passed into the CLI constructor are used. The set of supported
helpOpts are defined by
[dashdash](https://github.com/trentm/node-dashdash#help-config).
- `CLI.prototype.do_<subcmd>.help = <string>;` to set the help string for a

@@ -170,0 +176,0 @@ subcommand.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc