Skip to content

Nest --exit-after-create inside the grid size in main.py's usage line - #68

Merged
dmccoystephenson merged 1 commit into
mainfrom
feature/usage-line-nests-flag
Nov 13, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
feature/usage-line-nests-flag

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

  • main.py's usage line is changed from [gridSize] [--exit-after-create] to [gridSize [--exit-after-create]], so the flag is shown as following a grid size. This matches parseArgs, which reads the flag only as the second argument. Direction 1 from the issue was chosen because it changes no behaviour: create_environments.bat already passes the flag second, and the TestParseArgs characterization tests (including test_the_flag_given_first_is_read_as_an_invalid_grid_size) still hold unchanged.
  • The TestCliEntrypoint usage assertion is updated to the new string.
  • The README's Running section now quotes the usage line and explains what the nested brackets mean. The existing paragraph about where the flag is read already describes the positional rule.

Closes #67

Deferred issues

Test plan

  • python3 -m py_compile main.py graphik.py __init__.py
  • python3 -m unittest discover -s tests: Ran 209 tests, OK
  • Mutation check: with the old usage string restored in main.py, tests.test_main fails three subtests (--help, -h, 100 --help). With the change, it passes.
  • CI Tests workflow green on this head

This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).

🤖 Generated with Claude Code


drafted by Claude on behalf of Daniel Stephenson

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review rubric (performed inline. No independent reviewer was available in this headless run):

  • Scope: PASS. Three files changed, one line each: the usage string, its one assertion, and the README sentence about the usage line. No unrelated churn.
  • Tests-new: PASS (not applicable). No new function was added. The changed constant is asserted by the existing TestCliEntrypoint.test_asking_for_usage_prints_it_and_exits_without_side_effects.
  • Tests-fix: PASS. With the old string restored in main.py, python3 -m unittest tests.test_main failed three subtests (--help, -h, 100 --help). With the change, all 56 tests passed.
  • Sibling structure: PASS. No new files.
  • Sibling renames: PASS (not applicable). No identifiers were renamed.
  • Docs: PASS. The README Running section quotes the new line. The paragraph above it (README.md:218) already states that the flag is recognised only in second position. create_environments.bat passes <size> --exit-after-create, which is consistent with the nested form.
  • Issue resolution: PASS. main.py's usage line implies --exit-after-create can be given without a grid size #67's acceptance criteria are met: the usage line and parseArgs agree, the README is updated, and the TestParseArgs tests still characterize the positional rule unchanged.
  • Manual validation: PASS. py_compile succeeded and 209 tests ran OK locally. CI test passed on head 6e112a7. A live Viron/pygame run was not applicable because no rendering or service-call code changed.

Inline notes:

  • README.md:220: the sentence now ends with the bracket explanation, followed by a colon that introduces the python main.py --help example. That reads slightly less directly than before, but it is still accurate. No change was made.
  • main.py:26: -h/--help are not listed in the usage line. This predates this PR and is out of scope.

This review comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson
dmccoystephenson merged commit 5c94e41 into main Nov 13, 2026
1 check passed
@dmccoystephenson
dmccoystephenson deleted the feature/usage-line-nests-flag branch November 13, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

main.py's usage line implies --exit-after-create can be given without a grid size

1 participant