fix(cli): help text names the command the user actually ran - #4
Merged
Merged
Conversation
Installed, the entry point is `open-m711pro`, but every usage line said `python3 main.py` — pointing people at a file a pip install does not give them. The program name is now substituted into the docstring and the usage constants. argv[0] is only trusted when it is recognisable: `main.py` means a source checkout, a name starting with `open-m711pro` means the installed entry point, and anything else (a test runner, `python -m`, an embedding host) falls back to the canonical command rather than echoing a path that would mislead. A first attempt returned the basename unconditionally, which made the help say "run_tests.py" under the test runner. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Installed, the entry point is
open-m711pro, but every usage line saidpython3 main.py— a file a pip install does not provide. Caught while smoke-testing the v0.1.0 wheel.argv[0] is trusted only when recognisable:
main.pymeans a checkout, a name starting withopen-m711promeans the installed entry point, anything else falls back to the canonical command. A first attempt returned the basename unconditionally and made the help say "run_tests.py" under the test runner — the three CLI tests caught it.114 tests pass.
🤖 Generated with Claude Code