Repository navigation
fix(cli): turn clap help back on — no binary could print its own help - #99
Merged
Merged
Conversation
$ pasu-proxy --help
error: unexpected argument found
Every flag these binaries have is documented only in --help, so the answer to
"what can this do" was "read the source". It was not a code bug: clap's help
and usage are DEFAULT features, the workspace sets default-features = false,
and the feature list named only std. With help absent, --help is not a flag,
so clap answers it as an unknown argument.
error-context comes with it. Without that, a missing required argument said
only that one was missing; it now names which:
error: the following required arguments were not provided:
--policy <POLICY>
--upstream <UPSTREAM>
Colour and suggestions stay off — they were not what was missing.
All three binaries share the workspace dependency, so all three were affected,
and all three now carry the same test: --help must produce DisplayHelp rather
than UnknownArgument. One test in one crate would leave the next feature trim
free to break the other two silently.
The comment sits on the dependency line, since that is where the mistake was
made and where it would be made again.
Closes #97
Co-Authored-By: Claude Opus 5 <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.
Closes #97.
Every flag these binaries have is documented only in
--help, so the answer to "what can this do" was read the source.Not a code bug
clap's
helpandusageare default features. The workspace setsdefault-features = falseand named onlystd. Withhelpabsent,--helpis not a flag at all, so clap answers it as an unknown argument.error-contextcomes with the fix. Without it a missing required argument said only that one was missing; it now names which:Colour and suggestions stay off — they were not what was missing.
All three binaries, all three tested
pasu,pasu-daemonandpasu-proxyshare the workspace dependency, so all three were affected. Each now carries the same test:--helpmust produceDisplayHelp, notUnknownArgument. One test in one crate would leave the next feature trim free to break the other two silently.Only
pasu-proxybuilds on macOS (the others pull the eBPF stack), so the Linux job is what proves the other two.The comment sits on the dependency line, since that is where the mistake was made and where it would be made again.
🤖 Generated with Claude Code