* Return program help documentation. * * @param {{ error: boolean }} [contextOptions] - pass {error:true} to wrap for stderr instead of stdout * @return {string}
(contextOptions)
| 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 |
no test coverage detected