Skip to content

Commit

Permalink
Support Node.js 0.10 (Revert #1059) (#1074)
Browse files Browse the repository at this point in the history
fix #1073
  • Loading branch information
abetomo authored Oct 11, 2019
1 parent 48b02f0 commit a591f87
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2.20.2 / 2019-10-11
==================

* Support Node.js 0.10 (Revert #1059)

2.20.1 / 2019-09-29
==================

Expand Down
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Option.prototype.is = function(arg) {
function Command(name) {
this.commands = [];
this.options = [];
this._execs = new Set();
this._execs = {};
this._allowUnknownOption = false;
this._args = [];
this._name = name || '';
Expand Down Expand Up @@ -178,7 +178,7 @@ Command.prototype.command = function(name, desc, opts) {
if (desc) {
cmd.description(desc);
this.executables = true;
this._execs.add(cmd._name);
this._execs[cmd._name] = true;
if (opts.isDefault) this.defaultExecutable = cmd._name;
}
cmd._noHelp = !!opts.noHelp;
Expand Down Expand Up @@ -484,7 +484,7 @@ Command.prototype.parse = function(argv) {
})[0];
}

if (this._execs.has(name)) {
if (this._execs[name] === true) {
return this.executeSubCommand(argv, args, parsed.unknown);
} else if (aliasCommand) {
// is alias of a subCommand
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "commander",
"version": "2.20.1",
"version": "2.20.2",
"description": "the complete solution for node.js command-line programs",
"keywords": [
"commander",
Expand Down

0 comments on commit a591f87

Please sign in to comment.