{"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":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/status.js","lineNumber":67,"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":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/status.js#L49-L85","documentation":"Thrown by scripts/status.js when --write appears in argv but no file path follows it. The parser stores `args[index + 1] || null` into writePath, and the post-parse guard `args.includes('--write') && !parsed.writePath` rejects a null path. --write is meant to persist the chosen output format (JSON or Markdown) to disk, so a missing target path makes the operation meaningless.","triggerScenarios":"`node scripts/status.js --json --write` (no path after --write); a wrapper that appends `--write $OUTFILE` where $OUTFILE is unset.","commonSituations":"An output-path environment variable that is not exported or is empty; editing a command and deleting the path but not the flag; a CI template that conditionally includes --write but leaves the path blank in one branch.","solutions":["Provide a destination path: `node scripts/status.js --json --write /tmp/ecc-status.json`.","Ensure you also pass --json or --markdown, since --write alone triggers a separate error (error 465).","Verify the path variable in your wrapper script is non-empty before appending the flag."],"exampleFix":"// before\nnode scripts/status.js --json --write\n\n// after\nnode scripts/status.js --json --write /tmp/ecc-status.json","handlingStrategy":"validation","validationCode":"// Only set --write when both a path and a format are chosen\nconst outFile = process.env.ECC_STATUS_OUT;\nconst args = ['--json'];\nif (outFile) {\n  args.push('--write', outFile);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pair --write with --json or --markdown in the same branch.","Validate the output path is a writable location before invoking.","Build the --write and format flags together so they cannot diverge."],"tags":["cli","argument-parsing","missing-value","status","filesystem"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}