Skip to content

Commit

Permalink
Fix tj#256: automatically call addImplicitHelpCommand for sub-commands
Browse files Browse the repository at this point in the history
Move the setting of executables to true from the command method’s handling
of its undocumented desc parameter to the description method.
  • Loading branch information
rrthomas committed Mar 16, 2018
1 parent d8404f8 commit 84ea4dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ Command.prototype.command = function(name, desc, opts) {

if (desc) {
cmd.description(desc);
this.executables = true;
this._execs[cmd._name] = true;
if (opts.isDefault) this.defaultExecutable = cmd._name;
}
Expand Down Expand Up @@ -876,6 +875,7 @@ Command.prototype.version = function(str, flags) {

Command.prototype.description = function(str, argsDescription) {
if (arguments.length === 0) return this._description;
this.executables = true;
this._description = str;
this._argsDescription = argsDescription;
return this;
Expand Down

0 comments on commit 84ea4dc

Please sign in to comment.