bundled options don't seem to work properly
Bug #1438640 reported by
Nelson Elhage
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gnuflag |
New
|
Undecided
|
Unassigned |
Bug Description
The following test runs without error, but yields `a=true b=false`, as opposed to `a=true b=true` as I would expect, based on the documentation and on other GNU-style option parsers…
package main
import (
"fmt"
flag "launchpad.
)
func main() {
var a, b bool
set := &flag.FlagSet{}
set.BoolVar(&a, "a", false, "")
set.BoolVar(&b, "b", false, "")
set.Parse(true, []string{"-ab"})
fmt.Printf("a=%v b=%v\n", a, b)
}
Related branches
To post a comment you must log in.
Ah, looking further, it's a bug with handling bundled options at EOL. Attached a bzr branch that I believe fixes the issue, along with a test case.
Is gnuflag still maintained / in active use anywhere, or is this a ~dead project? Should I be looking for an alternative solution?