Repository navigation
Print a usage line for --help instead of creating an environment - #58
Merged
Merged
Conversation
parseArgs read --help as an unparseable grid size, so asking for help created a 50x50 environment, wrote environments.json and settings.json, reported usage and opened the render loop. The entrypoint now checks for --help and -h first and exits with status 0. Closes #57 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (anchored on CI run 42003869406, which passed at head
Notes:
The diff is review-ready. No do-not-auto-merge path is touched, and no file has any lines deleted. This review comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
python main.py --helpand-h, in any position, now printUsage: python main.py [gridSize] [--exit-after-create]and exit with status0.50, created an environment through Viron, wroteenvironments.jsonandsettings.json, reported usage and entered the render loop.__main__block ahead ofparseArgs, soparseArgsandmain()are unchanged, and the documented fallback for other unparseable values still applies.Closes #57
Test plan
python3 -m unittest discover -s tests: 170 tests ran, OK (165 before, plus 5 new)python3 -m py_compileon every module listed in the CI workflow passespython3 headless_run.py: all three scenarios PASS with the real Pygame on SDL's dummy drivers__main__guard removed, the new entrypoint test failed in all three subtests, because the run reachedmain(). Restoring the guard returned the suite to green__main__block on SDL's dummy drivers with in-memory services showed the side effects quoted in python main.py --help creates an environment instead of printing usage #57python3 main.py 10 --exit-after-createagainst a live Viron) is UNVERIFIED-not-applicable: neithermain(), the render loop nor any Viron-service call is changed--helpcannot be answered without the Viron submodule or on an interpreter below Python 3.9, becausemain.pyimports Viron at module scope, ahead of the check. Moving those imports was left out as a larger change than #57 calls for.Deferred issues
Vironsubmodule requires explicit authorization.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