addHelpText(position, text) {
    const allowedValues = ['beforeAll', 'before', 'after', 'afterAll'];
    if (!allowedValues.includes(position)) {
      throw new Error(`Unexpected value for position to addHelpText.
Expecting one of '${allowedValues.join("', '")}'`);
    }

    const helpEvent = `${position}Help`;
    this.on(helpEvent, (/** @type {HelpTextEventContext} */ context) => {
      let helpStr;
      if (typeof text === 'function') {
        helpStr = text({ error: context.error, command: context.command });
      } else {
        helpStr = text;
      }
      // Ignore falsy value when nothing to output.
      if (helpStr) {
        context.write(`${helpStr}\n`);
      }
    });
    return this;
  }
Add additional text to be displayed with the built-in help.

Position is 'before' or 'after' to affect just this command,
and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.

@param {string} position - before or after built-in help
@param {(string | Function)} text - string to add, or a function returning a string
@return {Command} `this` command for chaining