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.1.0 to 3.2.0

11

CHANGES.md
# node-cmdln Changelog
## 3.2.0
- [pull #7] Support for *hidden* command aliases to allow renaming a command
while preserving the old name (though not documenting it).
MyCLI.prototype.do_frob.hiddenAliases = ['ye-old-frob'];
MyCLI.prototype.do_frob.aliases = ['fr'];
By Dave Pacheco.
## 3.1.0

@@ -4,0 +15,0 @@

6

lib/cmdln.js

@@ -248,2 +248,3 @@ /*

var func = proto[funcname];
var allAliases;
if (func.prototype.__proto__ === Cmdln.prototype) {

@@ -302,3 +303,6 @@ // XXX doesn't catch multi-level inheritance from `Cmdln`

self._nameFromAlias[name] = name;
(func.aliases || []).forEach(function (alias) {
allAliases = func.aliases || [];
if (func.hiddenAliases)
allAliases = allAliases.concat(func.hiddenAliases);
allAliases.forEach(function (alias) {
self._nameFromAlias[alias] = name;

@@ -305,0 +309,0 @@ });

2

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

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

@@ -159,7 +159,16 @@ `node-cmdln` is a node.js helper lib for creating CLI tools with subcommands

- `CLI.prototype.do_<subcmd> = <SubCLI>;` Alternatively a `do_<subcmd>` can
be set to another Cmdln subclass to support sub-subcommands, like
`git remote add|remove|rename|...`. See
- `CLI.prototype.do_<subcmd> = <SubCLI>;` Instead of a function handler for a
subcommand, a `do_<subcmd>` can be set to another Cmdln subclass to support
sub-subcommands, like `git remote add|remove|rename|...`. See
["examples/fauxgit.js"](./examples/fauxgit.js) for an example.
- `CLI.prototype.do_<subcmd>.aliases = <array of strings>;` to define one or
more aliases for a command. These aliases are shown in the "Commands:"
section of the generated help output.
- `CLI.prototype.do_<subcmd>.hiddenAliases = <array of strings>;` to define one
or more aliases for a command **that are not shown in the generated help
output**. This can be useful when renaming a subcommand in a new version of
a tool and still support the old name.
- `CLI.prototype.do_<subcmd>.options = <object>;` is how to set the options

@@ -166,0 +175,0 @@ (in [dashdash](https://github.com/trentm/node-dashdash) format) for that

@@ -1,7 +0,1 @@

# 2.1?
- bash completion generation support
- docs: see below
# bash completion

@@ -8,0 +2,0 @@

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