pflag icon indicating copy to clipboard operation
pflag copied to clipboard

Drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags.

Results 112 pflag issues
Sort by recently updated
recently updated
newest added

Code Example: ```go package main import ( "fmt" "github.com/spf13/pflag" ) func main() { fs := pflag.NewFlagSet("test", pflag.PanicOnError) fs.StringToString("testflag", map[string]string{}, "") fs.Set("testflag", "x=[]") fmt.Println(fs.Lookup("testflag").Value.String()) result, _ := fs.GetStringToString("testflag") fmt.Println(result) } ```...

minimal repro code: ``` package main import ( "fmt" "github.com/spf13/cobra" ) var ( name string count int enabled bool ) var cmd = &cobra.Command{ Use: "test", RunE: func(cmd *cobra.Command, args...