bundled options don't seem to work properly

Bug #1438640 reported by Nelson Elhage
6
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.net/gnuflag"
)

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)
}

Revision history for this message
Nelson Elhage (nelhage) wrote :

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?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.