-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flag: Parse eats the double dash inconsistently #53691
Comments
Additionnal note, this is most likely caused by I also understand that, most likely, this might be an expected behavior — or at least command lines using the package might depend on this particular behavior. |
This is documented as:
"After Closing as this appears to be working as designed. |
@seankhliao This is actually a bit tricky.
It does not imply (I think) that it should be consumed, as the "first non-flag argument" is not consumed either. Maybe we just need to document it in addition (aka adding somehowe that the "terminator" will be consumed). |
It says before first non flag argument (so it's not consumed) or after the terminator (so consumed) |
Oh thank you @seankhliao, for some reason it did not "click" in my head (the after). All right, it does works as expected by the documentation then. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
With the given go code:
The way the go
flag
packages act with the--
special argument is inconsistent.What did you expect to see?
What did you see instead?
This makes it relatively hard to use
--
in some cases (aka here, when there is flags and--
and no "non-flag" argument between the two)The text was updated successfully, but these errors were encountered: