function disengageBooleanArgs(argv, booleanKeys) {
  const result = {};
  const passthrough = [];

  for (const entry of Object.entries(argv)) {
    const [key, value] = entry;
    if (key === '_' || key === '--') {
      continue;
    }

    const positiveKey = key.startsWith('no-') ? key.slice(3) : key;
    if (booleanKeys.has(positiveKey) && typeof value !== 'boolean') {
      result[positiveKey] = key === positiveKey;
      passthrough.push(value);
    } else {
      result[key] = value;
    }
  }

  return {
    ...result,
    '_': passthrough.concat(argv._),
    '--': argv['--'] || [],
  };
}
@param {Record<string, *>} argv
@param {Set<string>} booleanKeys
@returns {Record<string, *>}