Skip to content

Commit

Permalink
Fix to support Node.js 0.10 in v2
Browse files Browse the repository at this point in the history
  • Loading branch information
abetomo committed Oct 11, 2019
1 parent e9929fb commit 93c9e73
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ exports.CommanderError = CommanderError;
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 @@ -174,7 +174,7 @@ Command.prototype.command = function(nameAndArgs, actionOptsOrExecDesc, execOpts
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 @@ -601,7 +601,7 @@ Command.prototype.parse = function(argv) {
});
}

if (this._execs.has(name)) {
if (this._execs[name]) {
return this.executeSubCommand(argv, args, parsed.unknown, subCommand ? subCommand._executableFile : undefined);
}

Expand Down

0 comments on commit 93c9e73

Please sign in to comment.