summaryrefslogtreecommitdiff
path: root/vendor/github.com/spf13/pflag/flag.go
diff options
context:
space:
mode:
authordependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>2019-09-30 12:40:08 +0000
committerValentin Rothberg <rothberg@redhat.com>2019-09-30 15:03:39 +0200
commitc245ef9d1b2322a35344bbf837baaf3892378bef (patch)
tree13b545f5743e8f047b1291d276334aeb11c0da97 /vendor/github.com/spf13/pflag/flag.go
parent01b7af8ee9b3df1439c4da109ba11e7410108dab (diff)
downloadpodman-c245ef9d1b2322a35344bbf837baaf3892378bef.tar.gz
podman-c245ef9d1b2322a35344bbf837baaf3892378bef.tar.bz2
podman-c245ef9d1b2322a35344bbf837baaf3892378bef.zip
Bump github.com/spf13/pflag from 1.0.3 to 1.0.5
Bumps [github.com/spf13/pflag](https://github.com/spf13/pflag) from 1.0.3 to 1.0.5. - [Release notes](https://github.com/spf13/pflag/releases) - [Commits](https://github.com/spf13/pflag/compare/v1.0.3...v1.0.5) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'vendor/github.com/spf13/pflag/flag.go')
-rw-r--r--vendor/github.com/spf13/pflag/flag.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/vendor/github.com/spf13/pflag/flag.go b/vendor/github.com/spf13/pflag/flag.go
index 9beeda8ec..24a5036e9 100644
--- a/vendor/github.com/spf13/pflag/flag.go
+++ b/vendor/github.com/spf13/pflag/flag.go
@@ -57,9 +57,9 @@ that give one-letter shorthands for flags. You can use these by appending
var ip = flag.IntP("flagname", "f", 1234, "help message")
var flagvar bool
func init() {
- flag.BoolVarP("boolname", "b", true, "help message")
+ flag.BoolVarP(&flagvar, "boolname", "b", true, "help message")
}
- flag.VarP(&flagVar, "varname", "v", 1234, "help message")
+ flag.VarP(&flagval, "varname", "v", "help message")
Shorthand letters can be used with single dashes on the command line.
Boolean shorthand flags can be combined with other shorthand flags.
@@ -190,6 +190,18 @@ type Value interface {
Type() string
}
+// SliceValue is a secondary interface to all flags which hold a list
+// of values. This allows full control over the value of list flags,
+// and avoids complicated marshalling and unmarshalling to csv.
+type SliceValue interface {
+ // Append adds the specified value to the end of the flag value list.
+ Append(string) error
+ // Replace will fully overwrite any data currently in the flag value list.
+ Replace([]string) error
+ // GetSlice returns the flag value list as an array of strings.
+ GetSlice() []string
+}
+
// sortFlags returns the flags as a slice in lexicographical sorted order.
func sortFlags(flags map[NormalizedName]*Flag) []*Flag {
list := make(sort.StringSlice, len(flags))