Context
Found by the repo-wide /code-tidying:batch-simplify sweep (62 groups / 986 files, branch claude/repo-code-tidying-batch-twhddw). The sweep's doctrine files latent defects instead of fixing them mid-sweep, because the fix changes observable behavior; this issue is that filing.
scripts/lib/read-list.sh:69-71 — shift 2 || true never shifts when only one positional remains (bash leaves params untouched when n > $#), so the option loop re-reads --comments indefinitely. Empirically confirmed: timeout 3 exits 124. No current caller invokes it this way (all seven pass a mode).
Proposed work
- Validate the option's argument before
shift 2 and fail with the usage error instead of looping.
Acceptance criteria
References
scripts/lib/read-list.sh:69-71
Filed by the /code-tidying:batch-simplify closeout (Phase 8).
Context
Found by the repo-wide
/code-tidying:batch-simplifysweep (62 groups / 986 files, branchclaude/repo-code-tidying-batch-twhddw). The sweep's doctrine files latent defects instead of fixing them mid-sweep, because the fix changes observable behavior; this issue is that filing.scripts/lib/read-list.sh:69-71—shift 2 || truenever shifts when only one positional remains (bash leaves params untouched when n > $#), so the option loop re-reads--commentsindefinitely. Empirically confirmed:timeout 3exits 124. No current caller invokes it this way (all seven pass a mode).Proposed work
shift 2and fail with the usage error instead of looping.Acceptance criteria
--commentsas the last argument exits non-zero with a usage message instead of hanging.References
scripts/lib/read-list.sh:69-71Filed by the /code-tidying:batch-simplify closeout (Phase 8).