{"record":{"id":"af812adaf3ba66ba","repo":"affaan-m/ECC","slug":"unknown-argument-arg-af812a","errorCode":null,"errorMessage":"Unknown argument: ${arg}","messagePattern":"Unknown argument: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/github-coordination.js","lineNumber":106,"sourceCode":"    validation: null, review: null, status: null, projectState: null,\n    positionals: [],\n  };\n\n  if (args.length > 0 && !args[0].startsWith('-')) {\n    parsed.command = args.shift();\n  }\n\n  for (let i = 0; i < args.length; i += 1) {\n    const arg = args[i];\n    if (BOOL_FLAGS.has(arg)) {\n      BOOL_FLAGS.get(arg)(parsed);\n    } else if (VALUE_FLAGS.has(arg)) {\n      VALUE_FLAGS.get(arg)(parsed, readValue(args, i, arg));\n      i += 1;\n    } else if (!arg.startsWith('-')) {\n      parsed.positionals.push(arg);\n    } else {\n      throw new Error(`Unknown argument: ${arg}`);\n    }\n  }\n\n  if (!parsed.command) parsed.command = 'sync';\n  if (!parsed.issueNumber && parsed.positionals.length > 0) {\n    parsed.issueNumber = normalizeIssueNumber(parsed.positionals[0]);\n  }\n\n  return parsed;\n}\n\nfunction dispatchCommand(options, ctx) {\n  const { store, policy, rootDir } = ctx;\n  const base = { configPath: options.configPath, dryRun: options.dryRun };\n\n  if (options.command === 'claim') {\n    if (!options.issueNumber) throw new Error('Missing issue number.');\n    return applyClaim(options.repo, options.issueNumber, {","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/github-coordination.js#L88-L124","documentation":"parseArgs() in scripts/github-coordination.js matches each argument against VALUE_FLAGS and BOOL_FLAGS and treats non-flag tokens as positionals. Any '--'-prefixed argument in neither map throws 'Unknown argument: <arg>'.","triggerScenarios":"Passing an unrecognized or misspelled flag such as `--issu 42`, `--verbose`, or flags copied from other scripts that github-coordination.js doesn't implement.","commonSituations":"Typos in flags, mixing up flag sets between ECC scripts (feedback.js vs github-coordination.js), using deprecated flags after a script update, or shell aliasing that injects extra options.","solutions":["Check the BOOL_FLAGS and VALUE_FLAGS maps (or script help) in scripts/github-coordination.js for valid flag names.","Fix the typo, e.g. `--issue` instead of `--issu`.","Remove flags that aren't supported; positional issue numbers are accepted without a flag."],"exampleFix":"// before\n$ node scripts/github-coordination.js --issu 42\nError: Unknown argument: --issu\n// after\n$ node scripts/github-coordination.js --issue 42","handlingStrategy":"validation","validationCode":"const KNOWN = new Set(['--issue','--status','--repo','--help','-h']);\nconst bad = process.argv.slice(2).filter(a => a.startsWith('--') && !KNOWN.has(a));\nif (bad.length) {\n  console.error(`Unknown flags: ${bad.join(', ')}`);\n  process.exit(1);\n}","typeGuard":"const isKnownFlag = (arg) => BOOL_FLAGS.has(arg) || VALUE_FLAGS.has(arg);","tryCatchPattern":"try {\n  run(argv);\n} catch (err) {\n  if (/^Unknown argument:/.test(err.message)) {\n    console.error(`${err.message}\\nSee scripts/github-coordination.js flag maps for valid options.`);\n    process.exit(1);\n  }\n  throw err;\n}","preventionTips":["Check BOOL_FLAGS/VALUE_FLAGS in scripts/github-coordination.js before adding flags.","Don't reuse flag names from other ECC scripts.","Update scripts after ECC upgrades that rename flags.","Use positional issue numbers where possible to reduce flag surface."],"tags":["cli","invalid-cli-argument","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"}