Skip to content

scripts: read-list.sh hangs forever when a bare --comments is the final argument #3426

Description

@kyle-sexton

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-71shift 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

  • Invoking read-list.sh with --comments as the last argument exits non-zero with a usage message instead of hanging.

References

  • scripts/lib/read-list.sh:69-71

Filed by the /code-tidying:batch-simplify closeout (Phase 8).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions