Repository navigation
fix: parse explicit short flag values - #511
Open
Rayan-and-beyond wants to merge 3 commits into
Open
Rayan-and-beyond wants to merge 3 commits into
Rayan-and-beyond wants to merge 3 commits into
Conversation
Ekko82
reviewed
Oct 28, 2026
Ekko82
left a comment
There was a problem hiding this comment.
Tested this head with Go 1.27.1 on Windows: the two added optional-value tests pass, while two of nine focused required-value cases fail. Those nine cases all pass at merge base 161f35a. I did not run the full suite.
Ekko82
reviewed
Oct 28, 2026
Ekko82
left a comment
There was a problem hiding this comment.
Retested 2456e99 on Windows/amd64 with Go 1.27.1: all nine original required-value cases now pass, including -n -1 and -s -pattern. Your two new regression cases and the two optional-value tests also pass. I did not run the full suite.
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.
Fixes #207.
A shorthand with
NoOptDefValnow accepts a following non-flag token as an explicit value, while preserving the existing shorthand-cluster and boolean behavior. So-v explicitcan override the no-option default, but-vbstill uses-v's default and continues with-b.The README now spells out that cluster behavior and the two unambiguous ways to pass an explicit value.
Checked with:
go test .gofmtgit diff --check