text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  const slugify = require("@sindresorhus/slugify");
  const chalk_1 = require("chalk");
  const stringLength = require("string-length");
  exports.title = function (content) {
      return '\n' + chalk_1.default.bold.underline(content) + '\n\n';
  };
  exports.body = function (content, leadingSpaces = 0, trailingSpaces = 0, lineWidth = Math.min(process.stdout.columns || 80, 80)) {
      const effectiveWidth = lineWidth - leadingSpaces - trailingSpaces;
      const lines = content.match(new RegExp(`.{1,${effectiveWidth}}`, 'g'));
      return ' '.repeat(leadingSpaces) + lines.join(' '.repeat(trailingSpaces) + '\n' + ' '.repeat(leadingSpaces)) + '\n';
  };
  exports.options = function (optionRules, leadingSpaces = 0, lineWidth = Math.min(process.stdout.columns || 80, 80)) {
      const left = {};
      const values = {};
      for (const key in optionRules) {
          if (optionRules.hasOwnProperty(key)) {
              left[key] = '';
              const rule = optionRules[key];
              left[key] += ' '.repeat(leadingSpaces);
              if (rule.alias) {
                  left[key] += chalk_1.default.bold(`-${rule.alias}, `);
              }
              left[key] += chalk_1.default.bold(`--${slugify(key)}`);
              switch (rule.type) {
                  case 'string':
                      left[key] += chalk_1.default.dim(' ' + chalk_1.default.underline('string'));
                      break;
                  case 'string[]':
                      left[key] += chalk_1.default.dim(' ' + chalk_1.default.underline('string') + ' ...');
                      break;
                  case 'number':
                      left[key] += chalk_1.default.dim(' ' + chalk_1.default.underline('number'));
                      break;
                  case 'number[]':
                      left[key] += chalk_1.default.dim(' ' + chalk_1.default.underline('number') + ' ...');
                      break;
                  case 'boolean':
                      break;
              }
          }
      }
      const longest = Object.values(left).reduce((p, c) => {
          return Math.max(p, stringLength(c));
      }, 0);
      const targetLength = longest + 4;
      for (const key in optionRules) {
          if (optionRules.hasOwnProperty(key)) {
              const padding = ' '.repeat(targetLength - stringLength(left[key]));
              const descLength = lineWidth - targetLength;
              const desc = optionRules[key].desc.match(new RegExp(`.{1,${descLength}}`, 'g')).join(`\n${' '.repeat(targetLength)}`);
              values[key] = left[key] + padding + desc;
          }
      }
      return Object.values(values).join('\n') + '\n';
  };
  