fix(#46): -h is not a failure, and a rejected flag is reported once - #53
Merged
fgm merged 1 commit intoAug 26, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #53 +/- ##
==========================================
+ Coverage 98.66% 98.82% +0.15%
==========================================
Files 4 4
Lines 150 170 +20
==========================================
+ Hits 148 168 +20
Misses 1 1
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
fgm
force-pushed
the
46-envrun--h-exits-125-and-prints-usage-on-standard-error
branch
from
August 26, 2026 21:26
f692a2e to
0b1c9e1
Compare
- -h previously returned a failing status - flag previously reported a bad flag twice Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
fgm
force-pushed
the
46-envrun--h-exits-125-and-prints-usage-on-standard-error
branch
from
August 26, 2026 21:27
0b1c9e1 to
85a45f9
Compare
fgm
deleted the
46-envrun--h-exits-125-and-prints-usage-on-standard-error
branch
August 26, 2026 21:29
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 #46. Both symptoms, one commit.
envrun -hprinted usage on standard error and exited 125. It now prints usage on standard output and exits 0, reading no environment file and running nothing.An unknown flag produced three outputs —
flag's message,flag's usage block, then envrun's attributed duplicate. It now produces one attributed line followed by usage.Not the fix the issue proposed
The issue expected
-hto arrive as an error needing "a sentinel error or a third return value". envrun declares-hand-helpinstead:flag's help handling fires only for a name no flag defines, so declaring them means it writes nothing, returns nothing, and the choice of stream is envrun's.The duplication was propagation, not routing.
flagwithContinueOnErrorreports the error itself and returns it so the caller can stop; envrun treated the return as unreported. Its output is discarded andparseArgsreports instead — it holds the set, so it is the only place that can put usage after the message.Decisions
-hdominates: other flags and the operand are ignored, assort,curlandpython3do. A-versiontest must sit below the-hone, or the dominance inverts invisibly.envrun failed:— sodocs/exit-status.mdneeded only a qualifier saying-h's 0 is outside the rule.fail/notestay the only diagnostic channel on stderr; output the user asked for goes to stdout.Tests
The old unknown-flag case could not see the duplication:
flagwrites toos.Stderrwherefailgoes throughlog, so an in-process count in either buffer sees one copy regardless. The replacement is a subprocess with a bufferedcmd.Stderr, checked by mutation to fail when the discard is removed.TestPrefixesMatchTheDocumentationreadsdocs/exit-status.mdandREADME.mdand asserts they quote the prefixes.#45 shipped as docs only, so this is the change
v0.3.0carries — and its tag is the release pipeline's first live run.🤖 Generated with Claude Code