INNER CODE UNIT · JavaScript

cli

yeoman/yo · lib/cli.js:25

const cli = generators.map(generator => {
  const minicli = meow({
    autoHelp: false, autoVersion: true, pkg, argv: generator, importMeta: import.meta,
  });
  const options = minicli.flags;
  const arguments_ = minicli.input;

  // Add un-camelized options too, for legacy
  // TODO: Remove some time in the future when generators have upgraded
  for (const key of Object.keys(options)) {
    const legacyKey = key.replaceAll(/[A-Z]/g, m => `-${m.toLowerCase()}`);
    options[legacyKey] = options[key];
  }

  return {opts: options, args: arguments_};
});

const firstCmd = cli[0] || {opts: {}, args: {}};

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…