{"record":{"id":"5998c591b127f208","repo":"affaan-m/ECC","slug":"unknown-argument-arg-5998c5","errorCode":null,"errorMessage":"unknown argument: ${arg}","messagePattern":"unknown argument: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"skills/council-multi-model/scripts/review-with-codex.js","lineNumber":74,"sourceCode":"\n  for (let index = 0; index < argv.length; index += 1) {\n    const arg = argv[index];\n    if (arg === '--consent-to-openai') {\n      options.consent = true;\n    } else if (arg === '--host-provider') {\n      options.hostProvider = argv[index + 1];\n      index += 1;\n    } else if (arg === '--timeout-seconds') {\n      const seconds = Number(argv[index + 1]);\n      if (!Number.isInteger(seconds) || seconds < 10 || seconds > 120) {\n        throw new Error('--timeout-seconds must be an integer from 10 to 120');\n      }\n      options.timeoutMs = seconds * 1000;\n      index += 1;\n    } else if (arg === '--help' || arg === '-h') {\n      options.help = true;\n    } else {\n      throw new Error(`unknown argument: ${arg}`);\n    }\n  }\n\n  if (options.help) return options;\n  if (!options.consent) {\n    throw new Error('explicit --consent-to-openai is required');\n  }\n  if (!HOST_PROVIDERS.has(options.hostProvider)) {\n    throw new Error('--host-provider must be anthropic, openai, or unknown');\n  }\n  return options;\n}\n\nfunction providerLabel(hostProvider) {\n  if (hostProvider === 'anthropic') return 'cross-provider external critique';\n  if (hostProvider === 'openai') return 'same-provider external critique';\n  return 'provider relationship unverified';\n}","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/council-multi-model/scripts/review-with-codex.js#L56-L92","documentation":"parseArgs in review-with-codex.js uses an explicit allowlist of flags (--consent-to-openai, --host-provider, --timeout-seconds, --help/-h, plus any others in the chain). Any argument that matches none of the branches falls into the else and throws 'unknown argument: <arg>'. It is a strict parser: no positional arguments or unknown flags are tolerated.","triggerScenarios":"Passing an unsupported flag like `--verbose`, `--model`, or `--timeout=30` (the parser requires space-separated form, so `--timeout-seconds=30` is itself an unknown argument), or passing a positional filename to a script that only accepts flags.","commonSituations":"Copy-pasting flags from another tool's CLI; using the `--flag=value` syntax where only `--flag value` is supported; a typo like `--consent-to-open-ai`; passing extra args from a wrapper that forwards \"$@\" indiscriminately.","solutions":["Run with --help to list exactly the flags this script accepts.","Use space-separated form: `--timeout-seconds 30` instead of `--timeout-seconds=30`.","Fix typos in flag names; consent flag is exactly `--consent-to-openai`.","Remove any positional arguments or unsupported flags from the invocation."],"exampleFix":"// before\nnode review-with-codex.js --timeout-seconds=30\n// Error: unknown argument: --timeout-seconds=30\n\n// after\nnode review-with-codex.js --timeout-seconds 30","handlingStrategy":"validation","validationCode":"const ALLOWED = new Set(['--consent-to-openai','--host-provider','--timeout-seconds','--help','-h']);\nfor (const a of argv) {\n  if (a.startsWith('--') && !ALLOWED.has(a)) throw new Error(`unsupported flag: ${a}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  run(args);\n} catch (e) {\n  if (String(e.message).startsWith('unknown argument:')) {\n    console.error(`${e.message} — run with --help for the flag list.`);\n  }\n}","preventionTips":["Always use space-separated flag syntax (--flag value), never --flag=value.","Run with --help once and copy flag names exactly into wrappers.","Avoid forwarding \"$@\" blindly from wrapper scripts; filter to known flags."],"tags":["cli","argument-parsing"],"backgroundTag":"invalid-cli-argument","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}