function getBypassAndGenerator(plop, passArgsBeforeDashes) {
  // See if there are args to pass to generator
  const eoaIndex = args.indexOf("--");
  const { plopArgV, eoaArg } = passArgsBeforeDashes
    ? { plopArgV: argv }
    : eoaIndex === -1
      ? { plopArgV: [] }
      : {
          plopArgV: minimist(args.slice(eoaIndex + 1, args.length)),
          eoaArg: args[eoaIndex + 1],
        };

  // locate the generator name based on input and take the rest of the
  // user's input as prompt bypass data to be passed into the generator
  let generatorName = "";
  let bypassArr = [];

  const generatorNames = plop.getGeneratorList().map((v) => v.name);
  for (let i = 0; i < argv._.length; i++) {
    const nameTest =
      (generatorName.length ? generatorName + " " : "") + argv._[i];
    if (listHasOptionThatStartsWith(generatorNames, nameTest)) {
      generatorName = nameTest;
    } else {
      let index = argv._.findIndex((arg) => arg === eoaArg);
      // If can't find index, slice until the very end - allowing all `_` to be passed
      index = index !== -1 ? index : argv._.length;
      // Force `'_'` to become undefined in nameless bypassArr
      bypassArr = argv._.slice(i, index).map((arg) =>
        /^_+$/.test(arg) ? undefined : arg,
      );
      break;
    }
  }

  return { generatorName, bypassArr, plopArgV };
}
Parses the user input to identify the generator to run and any bypass data
@param plop - The plop context
@param passArgsBeforeDashes - Should we pass args before `--` to the generator API