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

Method helpInformation

lib/command.js:2464–2475  ·  view source on GitHub ↗

* Return program help documentation. * * @param {{ error: boolean }} [contextOptions] - pass {error:true} to wrap for stderr instead of stdout * @return {string}

(contextOptions)

Source from the content-addressed store, hash-verified

2462 */
2463
2464 helpInformation(contextOptions) {
2465 const helper = this.createHelp();
2466 const context = this._getOutputContext(contextOptions);
2467 helper.prepareContext({
2468 error: context.error,
2469 helpWidth: context.helpWidth,
2470 outputHasColors: context.hasColors,
2471 });
2472 const text = helper.formatHelp(this, helper);
2473 if (context.hasColors) return text;
2474 return this._outputConfiguration.stripColor(text);
2475 }
2476
2477 /**
2478 * @typedef HelpContext

Calls 5

createHelpMethod · 0.95
_getOutputContextMethod · 0.95
stripColorMethod · 0.80
prepareContextMethod · 0.45
formatHelpMethod · 0.45

Tested by

no test coverage detected