flag

package
v0.0.0-...-730ab85 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoolFlag

type BoolFlag struct {
	Name     string
	Usage    string
	EnvVar   string
	Default  bool
	Variable *bool
	Action   func(string, *Set)
}

func (*BoolFlag) Apply

func (f *BoolFlag) Apply(set *Set)

Apply implements of Flag Apply function.

type Flag

type Flag interface {
	Apply(*Set)
}

type Float64Flag

type Float64Flag struct {
	Name     string
	Usage    string
	Default  float64
	Variable *float64
	Action   func(string, *Set)
}

func (*Float64Flag) Apply

func (f *Float64Flag) Apply(set *Set)

Apply implements of Flag Apply function.

type IntFlag

type IntFlag struct {
	Name     string
	Usage    string
	Default  int
	Variable *int
	Action   func(string, *Set)
}

func (*IntFlag) Apply

func (f *IntFlag) Apply(set *Set)

Apply implements of Flag Apply function.

type Set

type Set struct {
	*flag.FlagSet
	// contains filtered or unexported fields
}

func NewFlagSet

func NewFlagSet() *Set

func (*Set) Bool

func (fs *Set) Bool(name string) bool

func (*Set) BoolE

func (fs *Set) BoolE(name string) (bool, error)

func (*Set) Float64

func (fs *Set) Float64(name string) float64

func (*Set) Float64E

func (fs *Set) Float64E(name string) (float64, error)

func (*Set) Int

func (fs *Set) Int(name string) int64

func (*Set) IntE

func (fs *Set) IntE(name string) (int64, error)

func (*Set) Lookup

func (fs *Set) Lookup(name string) *flag.Flag

func (*Set) Parse

func (fs *Set) Parse() error

func (*Set) Register

func (fs *Set) Register(flags ...Flag)

func (*Set) String

func (fs *Set) String(name string) string

func (*Set) StringE

func (fs *Set) StringE(name string) (string, error)

func (*Set) Uint

func (fs *Set) Uint(name string) uint64

func (*Set) UintE

func (fs *Set) UintE(name string) (uint64, error)

type StringFlag

type StringFlag struct {
	Name     string
	Usage    string
	EnvVar   string
	Default  string
	Variable *string
	Action   func(string, *Set)
}

func (*StringFlag) Apply

func (f *StringFlag) Apply(set *Set)

Apply implements of Flag Apply function.

type UintFlag

type UintFlag struct {
	Name     string
	Usage    string
	Default  uint
	Variable *uint
	Action   func(string, *Set)
}

UintFlag is an uint flag implements of Flag interface.

func (*UintFlag) Apply

func (f *UintFlag) Apply(set *Set)

Apply implements of Flag Apply function.

Jump to

Keyboard shortcuts

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