commander 2.20.1 → 2.20.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/index.js +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/index.js
CHANGED
|
@@ -99,7 +99,7 @@ Option.prototype.is = function(arg) {
|
|
|
99
99
|
function Command(name) {
|
|
100
100
|
this.commands = [];
|
|
101
101
|
this.options = [];
|
|
102
|
-
this._execs =
|
|
102
|
+
this._execs = {};
|
|
103
103
|
this._allowUnknownOption = false;
|
|
104
104
|
this._args = [];
|
|
105
105
|
this._name = name || '';
|
|
@@ -178,7 +178,7 @@ Command.prototype.command = function(name, desc, opts) {
|
|
|
178
178
|
if (desc) {
|
|
179
179
|
cmd.description(desc);
|
|
180
180
|
this.executables = true;
|
|
181
|
-
this._execs
|
|
181
|
+
this._execs[cmd._name] = true;
|
|
182
182
|
if (opts.isDefault) this.defaultExecutable = cmd._name;
|
|
183
183
|
}
|
|
184
184
|
cmd._noHelp = !!opts.noHelp;
|
|
@@ -484,7 +484,7 @@ Command.prototype.parse = function(argv) {
|
|
|
484
484
|
})[0];
|
|
485
485
|
}
|
|
486
486
|
|
|
487
|
-
if (this._execs
|
|
487
|
+
if (this._execs[name] === true) {
|
|
488
488
|
return this.executeSubCommand(argv, args, parsed.unknown);
|
|
489
489
|
} else if (aliasCommand) {
|
|
490
490
|
// is alias of a subCommand
|