MCPcopy
hub / github.com/tj/commander.js / _dispatchHelpCommand

Method _dispatchHelpCommand

lib/command.js:1392–1407  ·  view source on GitHub ↗

* Invoke help directly if possible, or dispatch if necessary. * e.g. help foo * * @private

(subcommandName)

Source from the content-addressed store, hash-verified

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.

Callers 1

_parseCommandMethod · 0.95

Calls 4

helpMethod · 0.95
_findCommandMethod · 0.95
_dispatchSubcommandMethod · 0.95
_getHelpOptionMethod · 0.95

Tested by

no test coverage detected