summaryrefslogtreecommitdiff
path: root/vendor/github.com/victorhaggqvist/pflag/bool.go
diff options
context:
space:
mode:
authorVictor Häggqvist <[email protected]>2020-04-21 09:34:44 +0200
committerVictor Häggqvist <[email protected]>2020-04-21 09:34:44 +0200
commitd21f39eeebd3586e7faf4d83c7a8e12b6e04c82e (patch)
tree1793d726cd50cb2d3a4311d8bb38fbf3fbdeda12 /vendor/github.com/victorhaggqvist/pflag/bool.go
parentd0a84f15f765383e077fee487af61c0e2e6bdf6d (diff)
replace ini
Diffstat (limited to 'vendor/github.com/victorhaggqvist/pflag/bool.go')
-rw-r--r--vendor/github.com/victorhaggqvist/pflag/bool.go79
1 files changed, 0 insertions, 79 deletions
diff --git a/vendor/github.com/victorhaggqvist/pflag/bool.go b/vendor/github.com/victorhaggqvist/pflag/bool.go
deleted file mode 100644
index 617971a..0000000
--- a/vendor/github.com/victorhaggqvist/pflag/bool.go
+++ /dev/null
@@ -1,79 +0,0 @@
-package pflag
-
-import (
- "fmt"
- "strconv"
-)
-
-// optional interface to indicate boolean flags that can be
-// supplied without "=value" text
-type boolFlag interface {
- Value
- IsBoolFlag() bool
-}
-
-// -- bool Value
-type boolValue bool
-
-func newBoolValue(val bool, p *bool) *boolValue {
- *p = val
- return (*boolValue)(p)
-}
-
-func (b *boolValue) Set(s string) error {
- v, err := strconv.ParseBool(s)
- *b = boolValue(v)
- return err
-}
-
-func (b *boolValue) String() string { return fmt.Sprintf("%v", *b) }
-
-func (b *boolValue) IsBoolFlag() bool { return true }
-
-// BoolVar defines a bool flag with specified name, default value, and usage string.
-// The argument p points to a bool variable in which to store the value of the flag.
-func (f *FlagSet) BoolVar(p *bool, name string, value bool, usage string) {
- f.VarP(newBoolValue(value, p), name, "", usage)
-}
-
-// Like BoolVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) BoolVarP(p *bool, name, shorthand string, value bool, usage string) {
- f.VarP(newBoolValue(value, p), name, shorthand, usage)
-}
-
-// BoolVar defines a bool flag with specified name, default value, and usage string.
-// The argument p points to a bool variable in which to store the value of the flag.
-func BoolVar(p *bool, name string, value bool, usage string) {
- CommandLine.VarP(newBoolValue(value, p), name, "", usage)
-}
-
-// Like BoolVar, but accepts a shorthand letter that can be used after a single dash.
-func BoolVarP(p *bool, name, shorthand string, value bool, usage string) {
- CommandLine.VarP(newBoolValue(value, p), name, shorthand, usage)
-}
-
-// Bool defines a bool flag with specified name, default value, and usage string.
-// The return value is the address of a bool variable that stores the value of the flag.
-func (f *FlagSet) Bool(name string, value bool, usage string) *bool {
- p := new(bool)
- f.BoolVarP(p, name, "", value, usage)
- return p
-}
-
-// Like Bool, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) BoolP(name, shorthand string, value bool, usage string) *bool {
- p := new(bool)
- f.BoolVarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Bool defines a bool flag with specified name, default value, and usage string.
-// The return value is the address of a bool variable that stores the value of the flag.
-func Bool(name string, value bool, usage string) *bool {
- return CommandLine.BoolP(name, "", value, usage)
-}
-
-// Like Bool, but accepts a shorthand letter that can be used after a single dash.
-func BoolP(name, shorthand string, value bool, usage string) *bool {
- return CommandLine.BoolP(name, shorthand, value, usage)
-}