File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ class CAC extends EventEmitter {
2828 name : string
2929 commands : Command [ ]
3030 globalCommand : GlobalCommand
31- matchedCommand : Command
31+ matchedCommand ?: Command
32+ matchedCommandName ?: string
3233 /**
3334 * Raw CLI arguments
3435 */
@@ -147,14 +148,18 @@ class CAC extends EventEmitter {
147148
148149 private setParsedInfo (
149150 { args, options, rawOptions } : MriResult ,
150- matchedCommand ?: Command
151+ matchedCommand ?: Command ,
152+ matchedCommandName ?: string
151153 ) {
152154 this . args = args
153155 this . options = options
154156 this . rawOptions = rawOptions
155157 if ( matchedCommand ) {
156158 this . matchedCommand = matchedCommand
157159 }
160+ if ( matchedCommandName ) {
161+ this . matchedCommandName = matchedCommandName
162+ }
158163 return this
159164 }
160165
@@ -186,7 +191,7 @@ class CAC extends EventEmitter {
186191 ...mriResult ,
187192 args : mriResult . args . slice ( 1 )
188193 }
189- this . setParsedInfo ( parsedInfo , command )
194+ this . setParsedInfo ( parsedInfo , command , commandName )
190195 this . emit ( `command:${ commandName } ` , command )
191196 }
192197 }
You can’t perform that action at this time.
0 commit comments