function addOption(name, option) {
  let alias = name;

  // If the this is an option itself
  if ('description' in option) {
    if ('alias' in option) {
      alias = option.alias;
      yargs = yargs.alias(alias, name);
    }

    yargs = yargs.describe(alias, option.description);

    if ('default' in option) {
      const template = name.endsWith('-template');
      const def = template ? path.resolve(path.dirname(__dirname), option.default) : option.default;
      yargs = yargs.default(alias, def);

      if (option.default === true || option.default === false) {
        yargs = yargs.boolean(name);
      }
    } else if (option.required) {
      yargs = yargs.require(alias);
    }

    if ('map' in option) {
      optionsMap[option.map] = name;
    }
  }

  const { description, alias: optAlias, default: optDefault, map, ...children } = option;
  for (const [key, value] of Object.entries(children)) {
    addOption(`${name}-${key}`, value);
  }
}
Add a command line option

@param {string} name Option name
@param {object} option Option configuration