{"record":{"id":"af812adaf3ba66ba","repo":"affaan-m/ECC","slug":"unknown-argument-arg-af812a","errorCode":null,"errorMessage":"Unknown argument: ${arg}","messagePattern":"Unknown argument: (.+?)","errorType":"exception","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/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/github-coordination.js#L88-L124","documentation":"Thrown by the argument parser in scripts/github-coordination.js when a token is not a recognized boolean flag, not a recognized value flag, does not start with '-' (so it is not handled as a positional), and falls through to the else branch. Wait — actually any token starting with '-' that is not in BOOL_FLAGS or VALUE_FLAGS triggers this. Non-dash tokens are treated as positionals.","triggerScenarios":"Passing an unrecognized dash-prefixed flag such as `--verbose`, `--force`, or `-v` that is not registered in BOOL_FLAGS or VALUE_FLAGS. The parser iterates all args; unknown dash-flags hit the final else throw.","commonSituations":"Using a flag from documentation of a different tool, a typo in a flag name (e.g. `--isssue` instead of `--issue`), or a flag that was removed/renamed in a version update.","solutions":["Run `node scripts/github-coordination.js --help` to see all accepted flags.","Check for typos in flag names.","Remove the unsupported flag from your command.","If the flag should exist, verify you are running a compatible version of the script."],"exampleFix":"// before\nnode scripts/github-coordination.js sync --repo owner/repo --verbose\n// after\nnode scripts/github-coordination.js sync --repo owner/repo","handlingStrategy":"validation","validationCode":"const ALL_FLAGS = new Set([...BOOL_FLAGS.keys(), ...VALUE_FLAGS.keys()]);\nconst unknown = args.filter(a => a.startsWith('-') && !ALL_FLAGS.has(a) && !a.includes('='));\nif (unknown.length > 0) {\n  console.error(`Unknown flag(s): ${unknown.join(', ')}. Run --help for usage.`);\n  process.exit(1);\n}","typeGuard":"function isKnownFlag(arg, boolFlags, valueFlags) {\n  return boolFlags.has(arg) || valueFlags.has(arg);\n}","tryCatchPattern":null,"preventionTips":["Keep a help reference handy or use --help before running.","Validate flags in wrapper scripts before passing them through.","Use consistent flag naming and watch for typos."],"tags":["cli","argument-parsing","github","user-input"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}