{"record":{"id":"617053ae325c5e71","repo":"paperclipai/paperclip","slug":"flag-requires-a-comma-separated-value","errorCode":null,"errorMessage":"${flag} requires a comma-separated value","messagePattern":"(.+?) requires a comma-separated value","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/paperclip-runner/scripts/run-runner-live-eval-schedule.mjs","lineNumber":45,"sourceCode":");\nconst seed =\n  process.env.PAPERCLIP_EVAL_SCHEDULE_SEED ?? \"runner-live-seven-week-v1\";\nconst outputDirectory = resolve(\n  packageRoot,\n  \".paperclip-local/evals/workflows\",\n);\nconst historyDirectory = resolve(\n  process.env.PAPERCLIP_EVAL_HISTORY_DIR ?? resolve(outputDirectory, \"history\"),\n);\nawait mkdir(outputDirectory, { recursive: true });\n\nfunction selectorValues(flag, environmentName) {\n  const values = [];\n  for (let index = 0; index < process.argv.length; index += 1) {\n    if (process.argv[index] !== flag) continue;\n    const value = process.argv[index + 1];\n    if (!value || value.startsWith(\"--\")) {\n      throw new Error(`${flag} requires a comma-separated value`);\n    }\n    values.push(value);\n  }\n  if (process.env[environmentName]) values.push(process.env[environmentName]);\n  return [\n    ...new Set(\n      values.flatMap((value) =>\n        value\n          .split(\",\")\n          .map((entry) => entry.trim())\n          .filter(Boolean),\n      ),\n    ),\n  ];\n}\n\nfunction selectionLimit() {\n  const index = process.argv.indexOf(\"--limit\");","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/packages/paperclip-runner/scripts/run-runner-live-eval-schedule.mjs#L27-L63","documentation":"selectorValues scans process.argv for a repeated flag (e.g. --candidate, --profile-family) and requires each occurrence to be followed by a value. If the next argument is missing or itself starts with `--`, it throws this error. Values are comma-separated strings collected per flag occurrence plus an optional env fallback.","triggerScenarios":"`--candidate` as the last argument, `--candidate --limit 5` (next token is a flag), or `--candidate` followed by nothing after shell quoting strips the value.","commonSituations":"Empty quoted value \"\" being dropped or passed as flag-adjacent, reordering flags so one selector flag directly precedes another, forgetting the comma-separated list.","solutions":["Provide the value immediately after the flag: `--candidate id1,id2`.","Repeat the flag for multiple groups rather than nesting flags: `--candidate a --candidate b`.","Ensure the value does not begin with `--`; quote values that might."],"exampleFix":"// before\nnode run-runner-live-eval-schedule.mjs --candidate --limit 3\n// after\nnode run-runner-live-eval-schedule.mjs --candidate runner-acpx-claude --limit 3","handlingStrategy":"validation","validationCode":"const i = argv.indexOf('--candidate');\nif (i !== -1 && (!argv[i+1] || argv[i+1].startsWith('--'))) throw new Error('--candidate needs a value');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Place values immediately after their flag","Quote values starting with dashes","Keep selector flags last in scripted commands","Repeat flags instead of reordering"],"tags":["cli","argument-parsing","eval-schedule"],"backgroundTag":"invalid-flag-value","analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-09-10T03:14:50.855Z","contentChangedAt":"2026-09-10T03:14:50.855Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}