static computeArgumentsAndCleanup(url, options) {
    const settings = {...options.settings};
    const chromeFlags = options.settings && options.settings.chromeFlags;
    let chromeFlagsAsString = chromeFlags || '';
    if (!options.headful) chromeFlagsAsString += ' --headless=new';
    if (chromeFlagsAsString) settings.chromeFlags = chromeFlagsAsString;

    // Make sure we're not passing something that will ruin our runner.
    delete settings.auditMode;
    delete settings.gatherMode;
    delete settings.output;
    delete settings.outputPath;
    delete settings.channel;
    delete settings.listAllAudits;
    delete settings.listAllCategories;
    delete settings.printConfig;

    let cleanupFn = () => {};
    const lhArgs = [url, '--output', 'json', '--output-path', 'stdout'];

    if (Object.keys(settings).length) {
      const flagsFilename = `flags-${uuid.v4()}.json`;
      const flagsFilePath = path.join(getSavedReportsDirectory(), flagsFilename);
      lhArgs.push('--cli-flags-path', flagsFilePath);

      fs.writeFileSync(flagsFilePath, JSON.stringify(settings));
      cleanupFn = () => fs.unlinkSync(flagsFilePath);
    }

    return {args: lhArgs, cleanupFn};
  }
@param {string} url
@param {Partial<LHCI.CollectCommand.Options>} options
@return {{args: string[], cleanupFn: () => void}}