{"record":{"id":"08cfcf5f0cfda15c","repo":"affaan-m/ECC","slug":"missing-value-for-limit-08cfcf","errorCode":null,"errorMessage":"Missing value for --limit","messagePattern":"Missing value for --limit","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/status.js","lineNumber":75,"sourceCode":"    } 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}`);\n    console.log(`    Repo: ${session.repoRoot || '(unknown)'}`);\n    console.log(`    Started: ${session.startedAt || '(unknown)'}`);\n    console.log(`    Workers: ${session.workerCount}`);\n  }","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/status.js#L57-L93","documentation":"The --limit flag in scripts/status.js takes a numeric count of sessions/rows to display. parseArgs post-validates that when --limit appears in argv a parsed.limit value was captured; if the flag has no following value the guard throws \"Missing value for --limit\".","triggerScenarios":"Running `node scripts/status.js --limit` as the last argument, or `--limit --json` where --json is treated as a separate flag leaving limit unset.","commonSituations":"Forgetting the number; script-building code that interpolates an undefined limit variable; commands truncated when pasted.","solutions":["Provide a numeric value: `--limit 20`.","Check that the interpolated variable supplying the limit is defined and non-empty.","Remove --limit to use the script's default limit."],"exampleFix":"// before\nnode scripts/status.js --limit\n// after\nnode scripts/status.js --limit 20","handlingStrategy":"validation","validationCode":"const lIdx = process.argv.indexOf('--limit');\nif (lIdx !== -1 && (!process.argv[lIdx + 1] || process.argv[lIdx + 1].startsWith('--') || Number.isNaN(Number(process.argv[lIdx + 1])))) {\n  throw new Error('Missing or invalid value for --limit');\n}","typeGuard":null,"tryCatchPattern":"try {\n  runStatus(argv);\n} catch (e) {\n  if (e.message === 'Missing value for --limit') {\n    console.error('Usage: node scripts/status.js --limit <number>');\n    process.exitCode = 1;\n  } else throw e;\n}","preventionTips":["Always supply a numeric value with --limit (e.g. --limit 20).","Guard interpolated values in generated commands: `--limit \"${LIMIT:-10}\"`.","Validate the number is a positive integer before invoking."],"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"}