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

Method addHelpCommand

lib/command.js:444–456  ·  view source on GitHub ↗

* Add prepared custom help command. * * @param {(Command|string|boolean)} helpCommand - custom help command, or deprecated enableOrNameAndArgs as for `.helpCommand()` * @param {string} [deprecatedDescription] - deprecated custom description used with custom name only * @return {Command}

(helpCommand, deprecatedDescription)

Source from the content-addressed store, hash-verified

442 * @return {Command} `this` command for chaining
443 */
444 addHelpCommand(helpCommand, deprecatedDescription) {
445 // If not passed an object, call through to helpCommand for backwards compatibility,
446 // as addHelpCommand was originally used like helpCommand is now.
447 if (typeof helpCommand !== 'object') {
448 this.helpCommand(helpCommand, deprecatedDescription);
449 return this;
450 }
451
452 this._addImplicitHelpCommand = true;
453 this._helpCommand = helpCommand;
454 this._initCommandGroup(helpCommand);
455 return this;
456 }
457
458 /**
459 * Lazy create help command.

Calls 2

helpCommandMethod · 0.95
_initCommandGroupMethod · 0.95

Tested by

no test coverage detected