{"record":{"id":"9a2f2cd4b32e4426","repo":"affaan-m/ECC","slug":"missing-value-for-write","errorCode":null,"errorMessage":"Missing value for --write","messagePattern":"Missing value for --write","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/status.js","lineNumber":71,"sourceCode":"      parsed.limit = args[index + 1] || null;\n      index += 1;\n    } else if (arg === '--help' || arg === '-h') {\n      parsed.help = true;\n    } else {\n      throw new Error(`Unknown argument: ${arg}`);\n    }\n  }\n\n  if (parsed.json && parsed.markdown) {\n    throw new Error('Choose only one output format: --json or --markdown');\n  }\n\n  if (args.includes('--db') && !parsed.dbPath) {\n    throw new Error('Missing value for --db');\n  }\n\n  if (args.includes('--write') && !parsed.writePath) {\n    throw new Error('Missing value for --write');\n  }\n\n  if (args.includes('--limit') && !parsed.limit) {\n    throw new Error('Missing value for --limit');\n  }\n\n  return parsed;\n}\n\nfunction printActiveSessions(section) {\n  console.log(`Active sessions: ${section.activeCount}`);\n  if (section.sessions.length === 0) {\n    console.log('  - none');\n    return;\n  }\n\n  for (const session of section.sessions) {\n    console.log(`  - ${session.id} [${session.harness}/${session.adapterId}] ${session.state}`);","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/status.js#L53-L89","documentation":"scripts/status.js's --write flag expects an output file path. parseArgs post-validates that if --write appears in argv, a writePath was actually parsed; otherwise it throws \"Missing value for --write\". Without a path the script cannot know where to save the report.","triggerScenarios":"Running `node scripts/status.js --json --write` with no filename after --write, or `--write --limit 5` where the next token is another flag.","commonSituations":"Omitting the output filename; empty variable expansion for the path; copying a partial command line; flags reordered so --write is last.","solutions":["Append the output file path: `--write report.md`.","Verify the variable supplying the path is non-empty before invoking.","Drop --write if you only want output to stdout."],"exampleFix":"// before\nnode scripts/status.js --json --write\n// after\nnode scripts/status.js --json --write status-report.json","handlingStrategy":"validation","validationCode":"const wIdx = process.argv.indexOf('--write');\nif (wIdx !== -1 && (!process.argv[wIdx + 1] || process.argv[wIdx + 1].startsWith('--'))) {\n  throw new Error('Missing value for --write');\n}","typeGuard":null,"tryCatchPattern":"try {\n  runStatus(argv);\n} catch (e) {\n  if (e.message === 'Missing value for --write') {\n    console.error('Usage: node scripts/status.js --json --write <output-file>');\n    process.exitCode = 1;\n  } else throw e;\n}","preventionTips":["Pass the output filename right after --write.","Default the path in wrappers: `--write \"${OUT:-status.json}\"`.","Drop --write when stdout-only output is intended."],"tags":["cli","missing-value","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"}