Skip to content

Commit

Permalink
Fix a bug in command emit
Browse files Browse the repository at this point in the history
fixes: #843
fixes: #842
  • Loading branch information
abetomo authored and roman-vanesyan committed Aug 7, 2018
1 parent 25b06ee commit ad34717
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Expand Up @@ -660,7 +660,8 @@ Command.prototype.parseArgs = function(args, unknown) {
if (unknown.length > 0) {
this.unknownOption(unknown[0]);
}
if (this._args.filter(a => a.required).length === 0) {
if (this.commands.length === 0 &&
this._args.filter(function(a) { return a.required }).length === 0) {
this.emit('command:*');
}
}
Expand Down

0 comments on commit ad34717

Please sign in to comment.