flag

package
v1.5.7-beta.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitFlags

func InitFlags()

InitFlags normalizes and parses the command line flags

func WarnWordSepNormalizeFunc

func WarnWordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName

WarnWordSepNormalizeFunc changes and warns for flags that contain "_" separators

func WordSepNormalizeFunc

func WordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName

WordSepNormalizeFunc changes all flags that contain "_" separators

Types

type StringFlag added in v1.5.0

type StringFlag struct {
	// contains filtered or unexported fields
}

StringFlag is a string flag compatible with flags and pflags that keeps track of whether it had a value supplied or not.

func NewStringFlag added in v1.5.0

func NewStringFlag(defaultVal string) StringFlag

func (*StringFlag) Default added in v1.5.0

func (f *StringFlag) Default(value string)

func (StringFlag) Provided added in v1.5.0

func (f StringFlag) Provided() bool

func (*StringFlag) Set added in v1.5.0

func (f *StringFlag) Set(value string) error

func (StringFlag) String added in v1.5.0

func (f StringFlag) String() string

func (*StringFlag) Type added in v1.5.0

func (f *StringFlag) Type() string

func (StringFlag) Value added in v1.5.0

func (f StringFlag) Value() string

type Tristate

type Tristate int

Tristate is a flag compatible with flags and pflags that keeps track of whether it had a value supplied or not.

const (
	Unset Tristate = iota // 0
	True
	False
)

func (*Tristate) Default

func (f *Tristate) Default(value bool)

func (Tristate) Provided

func (f Tristate) Provided() bool

func (*Tristate) Set

func (f *Tristate) Set(value string) error

func (Tristate) String

func (f Tristate) String() string

func (*Tristate) Type

func (f *Tristate) Type() string

func (Tristate) Value

func (f Tristate) Value() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL