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

Method help

lib/command.js:2635–2648  ·  view source on GitHub ↗

* Output help information and exit. * * Outputs built-in help, and custom text added using `.addHelpText()`. * * @param {{ error: boolean }} [contextOptions] - pass {error:true} to write to stderr instead of stdout

(contextOptions)

Source from the content-addressed store, hash-verified

2633 */
2634
2635 help(contextOptions) {
2636 this.outputHelp(contextOptions);
2637 let exitCode = Number(process.exitCode ?? 0); // process.exitCode does allow a string or an integer, but we prefer just a number
2638 if (
2639 exitCode === 0 &&
2640 contextOptions &&
2641 typeof contextOptions !== 'function' &&
2642 contextOptions.error
2643 ) {
2644 exitCode = 1;
2645 }
2646 // message: do not have all displayed text available so only passing placeholder.
2647 this._exit(exitCode, 'commander.help', '(outputHelp)');
2648 }
2649
2650 /**
2651 * // Do a little typing to coordinate emit and listener for the help text events.

Callers 5

_dispatchSubcommandMethod · 0.95
_dispatchHelpCommandMethod · 0.95
_parseCommandMethod · 0.95
index.test-d.tsFile · 0.80

Calls 2

outputHelpMethod · 0.95
_exitMethod · 0.95

Tested by

no test coverage detected