{"record":{"id":"07fd01ef3d58df27","repo":"affaan-m/ECC","slug":"flagname-requires-a-value-07fd01","errorCode":null,"errorMessage":"${flagName} requires a value","messagePattern":"(.+?) requires a value","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/release-video-suite.js","lineNumber":342,"sourceCode":"    '  --format <text|json>     Output format (default: text)',\n    '  --json                   Alias for --format json',\n    '  --root <dir>             Repository root to inspect (default: cwd)',\n    '  --source-root <dir>      Directory containing ECC 2 source media, with optional _edited subdir',\n    '  --suite-root <dir>       Directory containing render/timeline/transcript outputs',\n    '  --skip-probe             Skip ffprobe duration reads for fixture or dry-run checks',\n    '  --summary                Emit compact JSON when used with --format json',\n    '  --help, -h               Show this help',\n    '',\n    'Environment:',\n    '  ECC_VIDEO_SOURCE_ROOT',\n    '  ECC_VIDEO_RELEASE_SUITE_ROOT',\n  ].join('\\n'));\n}\n\nfunction readArgValue(args, index, flagName) {\n  const value = args[index + 1];\n  if (!value || value.startsWith('--')) {\n    throw new Error(`${flagName} requires a value`);\n  }\n  return value;\n}\n\nfunction parseArgs(argv) {\n  const args = argv.slice(2);\n  const parsed = {\n    format: 'text',\n    help: false,\n    root: path.resolve(process.cwd()),\n    sourceRoot: process.env.ECC_VIDEO_SOURCE_ROOT || '',\n    suiteRoot: process.env.ECC_VIDEO_RELEASE_SUITE_ROOT || '',\n    skipProbe: false,\n    summary: false,\n  };\n\n  for (let index = 0; index < args.length; index += 1) {\n    const arg = args[index];","sourceCodeStart":324,"sourceCodeEnd":360,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/release-video-suite.js#L324-L360","documentation":"readArgValue in scripts/release-video-suite.js throws when a flag that expects a value is the last argument or is followed by another flag. It checks that the next argv entry exists and does not start with '--'.","triggerScenarios":"Running `node scripts/release-video-suite.js --format` (nothing after it) or `--format --json` (value looks like another flag).","commonSituations":"Forgetting the value after a flag, quoting/spacing mistakes leaving the value empty, accidentally passing the value in a separate position that starts with --.","solutions":["Provide the value inline after the flag, e.g. --format json.","Remember this script uses space-separated values (--format json), not the = form (--format=json may be handled elsewhere — verify).","Ensure the value itself doesn't begin with '--'."],"exampleFix":"// before\nnode scripts/release-video-suite.js --format\n// after\nnode scripts/release-video-suite.js --format json","handlingStrategy":"validation","validationCode":"const i = args.indexOf('--format');\nif (i !== -1 && (!args[i+1] || args[i+1].startsWith('--'))) throw new Error('--format requires a value');","typeGuard":null,"tryCatchPattern":"try { parsed = parseArgs(process.argv); } catch (e) { console.error(e.message); process.exit(2); }","preventionTips":["Always put the value on the same command line right after the flag","Never begin a value with '--'","Test new invocations with --dry-run or --help first"],"tags":["cli","argument-parsing"],"backgroundTag":"missing-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"}