Open ghost opened 1 year ago
Stacked short options are not recognized after first unknown option (even with flag IgnoreUnknown).
IgnoreUnknown
Following code sample:
package main import ( "fmt" "github.com/jessevdk/go-flags" ) var first struct { Query bool `short:"Q" long:"query"` } var second struct { Quick bool `short:"q" long:"quick"` } func main() { flags.NewParser(&first, flags.IgnoreUnknown).Parse() fmt.Println(first) flags.NewParser(&second, flags.IgnoreUnknown).Parse() fmt.Println(second) }
Produces results:
> go run . -Qq {true} {false} > go run . -qQ {false} {true} > go run . -Q -q {true} {true}
I expect true&true in each run, but results are different.
true
Stacked short options are not recognized after first unknown option (even with flag
IgnoreUnknown
).Following code sample:
Produces results:
I expect
true
&true
in each run, but results are different.