We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent af9d179 commit 442f469Copy full SHA for 442f469
src/CAC.ts
@@ -200,7 +200,7 @@ class CAC extends EventEmitter {
200
if (shouldParse) {
201
// Search the default command
202
for (const command of this.commands) {
203
- if (command.name === '') {
+ if (command.isDefaultCommand) {
204
shouldParse = false
205
const parsed = this.mri(argv.slice(2), command)
206
this.setParsedInfo(parsed, command)
@@ -220,7 +220,11 @@ class CAC extends EventEmitter {
220
this.unsetMatchedCommand()
221
}
222
223
- if (this.options.version && this.showVersionOnExit && this.matchedCommandName == null) {
+ if (
224
+ this.options.version &&
225
+ this.showVersionOnExit &&
226
+ this.matchedCommandName == null
227
+ ) {
228
this.outputVersion()
229
run = false
230
0 commit comments