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

Method _getHelpCommand

lib/command.js:464–478  ·  view source on GitHub ↗

* Lazy create help command. * * @return {(Command|null)} * @package

()

Source from the content-addressed store, hash-verified

462 * @package
463 */
464 _getHelpCommand() {
465 const hasImplicitHelpCommand =
466 this._addImplicitHelpCommand ??
467 (this.commands.length &&
468 !this._actionHandler &&
469 !this._findCommand('help'));
470
471 if (hasImplicitHelpCommand) {
472 if (this._helpCommand === undefined) {
473 this.helpCommand(undefined, undefined); // use default name and description
474 }
475 return this._helpCommand;
476 }
477 return null;
478 }
479
480 /**
481 * Add hook for life cycle event.

Callers 5

helpCommandMethod · 0.95
_parseCommandMethod · 0.95
parseOptionsMethod · 0.95
visibleCommandsMethod · 0.80

Calls 2

_findCommandMethod · 0.95
helpCommandMethod · 0.95

Tested by

no test coverage detected