{"record":{"id":"9438643573db7325","repo":"affaan-m/ECC","slug":"missing-value-for-argument-943864","errorCode":null,"errorMessage":"Missing value for ${argument}","messagePattern":"Missing value for (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/setup.js","lineNumber":84,"sourceCode":"    hooks: undefined,\n    json: false,\n    mode: undefined,\n    moveScope: false,\n    scope: undefined,\n    yes: false,\n  };\n  const valueFlags = new Map([\n    ['--mode', 'mode'],\n    ['--scope', 'scope'],\n    ['--hooks', 'hooks'],\n  ]);\n\n  for (let index = 0; index < argv.length; index += 1) {\n    const argument = argv[index];\n    if (valueFlags.has(argument)) {\n      const value = argv[index + 1];\n      if (!value || value.startsWith('--')) {\n        throw new Error(`Missing value for ${argument}`);\n      }\n      options[valueFlags.get(argument)] = value;\n      index += 1;\n    } else if (argument === '--yes' || argument === '-y') {\n      options.yes = true;\n    } else if (argument === '--dry-run') {\n      options.dryRun = true;\n    } else if (argument === '--move-scope') {\n      options.moveScope = true;\n    } else if (argument === '--json') {\n      options.json = true;\n    } else if (argument === '--help' || argument === '-h') {\n      options.help = true;\n    } else {\n      throw new Error(`Unknown argument: ${argument}`);\n    }\n  }\n","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/setup.js#L66-L102","documentation":"Thrown by setup.js parseArgs when a value flag (--mode, --scope, --hooks) is followed by no token or by a token beginning with '--'. The parser will not consume a neighboring flag as the value, matching the ECC pattern of strict value-flag handling.","triggerScenarios":"`node scripts/setup.js --scope` with nothing after; `--scope --hooks standard` (the second flag is read as scope's value and rejected); a value that was meant to be quoted but got dropped by the shell.","commonSituations":"Trailing flag at end of a CI command; reordering flags so value-flags collide; typos where a boolean flag is mistaken for a value flag.","solutions":["Provide the value immediately: `--scope user`.","Ensure the value does not start with '--'; quote it if it contains special characters.","Drop the flag if you want the interactive prompt to fill it.","Re-check the help output for which flags require values."],"exampleFix":"# before\nnode scripts/setup.js --scope --hooks standard\n# after\nnode scripts/setup.js --scope user --hooks standard","handlingStrategy":"validation","validationCode":"const VALUE_FLAGS = new Set(['--mode', '--scope', '--hooks']);\nfor (let i = 0; i < argv.length; i += 1) {\n  if (VALUE_FLAGS.has(argv[i]) && (!argv[i + 1] || argv[i + 1].startsWith('--'))) {\n    throw new Error(`Missing value for ${argv[i]}`);\n  }\n}","typeGuard":null,"tryCatchPattern":"try { parseArgs(process.argv); } catch (err) { console.error(err.message); printHelp(); process.exit(2); }","preventionTips":["Pre-flight validate value-flags before invoking setup.js.","Standardize on `--flag=value` to make collisions impossible."],"tags":["cli","argument-parsing","setup"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}