Skip to content

fix(cli): help text names the command the user actually ran - #4

Merged
mateusands merged 1 commit into
mainfrom
fix/usage-prog-name
Aug 8, 2026
Merged

mateusands merged 1 commit into
mainfrom
fix/usage-prog-name

Conversation

@mateusands

Copy link
Copy Markdown
Owner

Installed, the entry point is open-m711pro, but every usage line said python3 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.py means a checkout, a name starting with open-m711pro means 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

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>
@mateusands
mateusands merged commit d234df8 into main Aug 8, 2026
14 checks passed
@mateusands
mateusands deleted the fix/usage-prog-name branch August 8, 2026 19:36
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.

1 participant