-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Closed as not planned
Closed as not planned
Copy link
Labels
NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
Description
If the flag library encounters an unknown parameter, it discards that parameter and dumps everything else in the positional arguments bucket.
Instead, the flag library should (optionally, probably when ContinueOnError is specified) put all unknown parameters in the positional arguments bucket (returned by Args) and keep attempting to parse the following arguments. (unless encountering something that clearly indicated the beginning of positional arguments such as the naked double-dash "--")
- What version of Go are you using (
go version)?
go version go1.3.3 linux/amd64 - What operating system and processor architecture are you using (
go env)?
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/azani/go"
GORACE=""
GOROOT="/usr/lib/go"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1" - What did you do?
https://play.golang.org/p/44mXvwTfLD - What did you expect to see?
list == "first", "second", "third"
flagSet.Args() == "--something", "blah"
- What did you see instead?
list == "first", "second"
flagSet.Args() == "-I", "third", "blah"
also, Parse printed an error.
wallrj, RunsFor, josh-tepper, hungrybirder, MahouShoujoMivutilde and 3 more
Metadata
Metadata
Assignees
Labels
NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.Feedback is required from experts, contributors, and/or the community before a change can be made.