* Invoke help directly if possible, or dispatch if necessary. * e.g. help foo * * @private
(subcommandName)
| 1390 | */ |
| 1391 | |
| 1392 | _dispatchHelpCommand(subcommandName) { |
| 1393 | if (!subcommandName) { |
| 1394 | this.help(); |
| 1395 | } |
| 1396 | const subCommand = this._findCommand(subcommandName); |
| 1397 | if (subCommand && !subCommand._executableHandler) { |
| 1398 | subCommand.help(); |
| 1399 | } |
| 1400 | |
| 1401 | // Fallback to parsing the help flag to invoke the help. |
| 1402 | return this._dispatchSubcommand( |
| 1403 | subcommandName, |
| 1404 | [], |
| 1405 | [this._getHelpOption()?.long ?? this._getHelpOption()?.short ?? '--help'], |
| 1406 | ); |
| 1407 | } |
| 1408 | |
| 1409 | /** |
| 1410 | * Check this.args against expected this.registeredArguments. |
no test coverage detected