()
| 339 | } |
| 340 | |
| 341 | runMatchedCommand(): any { |
| 342 | const { args, options, matchedCommand: command } = this |
| 343 | |
| 344 | if (!command || !command.commandAction) return |
| 345 | |
| 346 | command.checkUnknownOptions() |
| 347 | |
| 348 | command.checkOptionValue() |
| 349 | |
| 350 | command.checkRequiredArgs() |
| 351 | |
| 352 | command.checkUnusedArgs() |
| 353 | |
| 354 | const actionArgs: any[] = [] |
| 355 | command.args.forEach((arg, index) => { |
| 356 | if (arg.variadic) { |
| 357 | actionArgs.push(args.slice(index)) |
| 358 | } else { |
| 359 | actionArgs.push(args[index]) |
| 360 | } |
| 361 | }) |
| 362 | actionArgs.push(options) |
| 363 | return command.commandAction.apply(this, actionArgs) |
| 364 | } |
| 365 | } |
no test coverage detected