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

It would be useful when dynamically adding [`Flags`](https://pkg.go.dev/github.com/spf13/pflag#Flag) to a [`FlagSet`](https://pkg.go.dev/github.com/spf13/pflag#FlagSet.AddFlag) to be allowed to reuse the underlying primitive implementations of a [`Value`](https://pkg.go.dev/github.com/spf13/pflag#Value). The boolean implementation for reference: https://github.com/spf13/pflag/blob/master/bool.go#L13 This...

I am facing the following issue: several commands in github.com/kubernetes-csi use the Go flag package for argument parsing. The single-dash flags are part of the API, so we can't just...

@duhruh opened https://github.com/kubernetes/kubernetes/pull/102634 to include some fixes in this project. Kubernetes needs a tagged version for upgrading `github.com/spf13/pflag`. Would you release one new version?

Implements https://github.com/spf13/pflag/issues/320

Hi, this is a feature request mainly to make cobra & viper integration easier. If the VarP-methods for flags are used then there is a pointer value for a variable...

this makes possible to do the following: ```go flag := pflag.Flag{ Name: "sample-option", Shorthand: "s", DefValue: "default value", Value: pflag.NewStringValue("default value", new(string)), Usage: "option you can add to cobra command...

For multiline descriptions it looks very weird sometimes when `(default ....)` section is placed at the end of paragraph. There is simple workaround - zero DefValue like this (cobra example):...

The documentation says: `Changed bool // If the user set the value (or if left to default) ` But it also says: ``` // Changed returns true if the flag...

One reoccurring issue I have run into is the merging of config files and command line flags. I know that viper solves some of these problems, but it also introduces...