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

When using a string slice `StringSliceVar` it is impossible to pass values with double quotes `"` The reason is that a CSVReader is used in the implementation ([here](https://github.com/spf13/pflag/blob/d5e0c0615acee7028e1e2740a11102313be88de1/string_slice.go#L27)) and it...

It no longer accepts Println with a constant ending with a newline: Fixes #368 ./flag_test.go:1242:3: fmt.Println arg list ends with redundant newline FAIL github.com/spf13/pflag [build failed] Also changing the previous...

I get a test failure with go 1.19.4 (amd64): ``` # github.com/spf13/pflag ./flag_test.go:1242:3: fmt.Println arg list ends with redundant newline FAIL github.com/spf13/pflag [build failed] ``` The behaviour changed in 1.18...

I have some flag definition code in cobra: ```go listCmd.Flags().IP("ip", nil, "--ip") ``` And then i running this: ```go ip, err := flags.GetIP("ip") ``` I got an error: `invalid string...

Rationale: the flag `--no-shave-yaks` alone is pretty clear: I don't want the program to shave any yaks. However `--no-shave-yaks=true` and `--no-shave-yaks=false` both get me confused with exactly how much negation...

# Motivation [Issue 362](https://github.com/spf13/pflag/issues/362) reported by @SOF3 # Changes Sort keys before stringifying string-to-string flag values. # Summary String-to-string default values in usage would print in sorted order of keys....

This is a first stab at adding complex128 as a flag type. I have basically cloned the float64 code and substituted `Complex` and `complex128` and added a few complex numbers...

While reading the source for this pkg, I noticed the usage of `bytes.Buffer` in places where Go 1.10's `strings.Builder` could be used instead. (It's intended for this and is marginally...

The actuals variants of the flag creation do not report back the generated Flag object. But this would be reqired to do further tweaking according to the public fields of...