Skip to content

Import path: gitlab.soludian.com/soludian/fountain/libs/fflag

fflag

go
import "gitlab.soludian.com/soludian/fountain/libs/fflag"

Index

func Bool

go
func Bool(name string) bool

Bool parses bool flag of the flagSet.

func BoolE

go
func BoolE(name string) (bool, error)

BoolE parses bool flag of the flagSet with error returned.

func Float64

go
func Float64(name string) float64

Float64 parses int flag of the flagSet.

func Float64E

go
func Float64E(name string) (float64, error)

Float64E parses int flag of the flagSet with error returned.

func Int

go
func Int(name string) int64

Int parses int flag of the flagSet.

func IntE

go
func IntE(name string) (int64, error)

IntE parses int flag of the flagSet with error returned.

func Parse

go
func Parse() error

Parse parses the flagSet.

func ParseWithArgs

go
func ParseWithArgs(arguments []string) error

ParseWithArgs parses the flagSet with given args.

func PrintDefaults

go
func PrintDefaults()

func Register

go
func Register(fs ...Flag)

Register...

func SetFlagSet

go
func SetFlagSet(fs *FlagSet)

SetFlagSet set flagSet

func String

go
func String(name string) string

String parses string flag of the flagSet.

func StringE

go
func StringE(name string) (string, error)

StringE parses string flag of the flagSet with error returned.

func Uint

go
func Uint(name string) uint64

Uint parses int flag of the flagSet.

func UintE

go
func UintE(name string) (uint64, error)

UintE parses int flag of the flagSet with error returned.

func With

go
func With(fs ...Flag)

With adds flags to the flagSet.

type BoolFlag

BoolFlag is a bool flag implements of Flag interface.

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

func (*BoolFlag) Apply

go
func (f *BoolFlag) Apply(set *FlagSet)

Apply implements of Flag Apply function.

type Flag

Flag defines application flag.

go
type Flag interface {
    Apply(*FlagSet)
}

type FlagSet

FlagSet wraps a set of Flags.

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

func NewFlagSet

go
func NewFlagSet(flagCommand *flag.FlagSet, flags ...Flag) *FlagSet

NewFlagSet new flagSet

func (*FlagSet) Bool

go
func (fs *FlagSet) Bool(name string) bool

Bool parses bool flag of provided flagSet.

func (*FlagSet) BoolE

go
func (fs *FlagSet) BoolE(name string) (bool, error)

BoolE parses bool flag of provided flagSet with error returned.

func (*FlagSet) Float64

go
func (fs *FlagSet) Float64(name string) float64

Float64 parses int flag of provided flagSet.

func (*FlagSet) Float64E

go
func (fs *FlagSet) Float64E(name string) (float64, error)

Float64E parses int flag of provided flagSet with error returned.

func (*FlagSet) Int

go
func (fs *FlagSet) Int(name string) int64

Int parses int flag of provided flagSet.

func (*FlagSet) IntE

go
func (fs *FlagSet) IntE(name string) (int64, error)

IntE parses int flag of provided flagSet with error returned.

func (*FlagSet) Lookup

go
func (fs *FlagSet) Lookup(name string) *flag.Flag

Lookup lookup flag value by name priority: flag > env > default

func (*FlagSet) Parse

go
func (fs *FlagSet) Parse() error

Parse parses provided flagSet.

func (*FlagSet) ParseWithArgs

go
func (fs *FlagSet) ParseWithArgs(arguments []string) error

ParseWithArgs parses provided flagSet with given args.

func (*FlagSet) Register

go
func (fs *FlagSet) Register(flags ...Flag)

Register...

func (*FlagSet) String

go
func (fs *FlagSet) String(name string) string

String parses string flag of provided flagSet.

func (*FlagSet) StringE

go
func (fs *FlagSet) StringE(name string) (string, error)

StringE parses string flag of provided flagSet with error returned.

func (*FlagSet) Uint

go
func (fs *FlagSet) Uint(name string) uint64

Uint parses int flag of provided flagSet.

func (*FlagSet) UintE

go
func (fs *FlagSet) UintE(name string) (uint64, error)

UintE parses int flag of provided flagSet with error returned.

func (*FlagSet) With

go
func (fs *FlagSet) With(flags ...Flag)

With adds flags to provided flagSet.

type Float64Flag

Float64Flag is a float flag implements of Flag interface.

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

func (*Float64Flag) Apply

go
func (f *Float64Flag) Apply(set *FlagSet)

Apply implements of Flag Apply function.

type IntFlag

IntFlag is an int flag implements of Flag interface.

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

func (*IntFlag) Apply

go
func (f *IntFlag) Apply(set *FlagSet)

Apply implements of Flag Apply function.

type StringFlag

StringFlag is a string flag implements of Flag interface.

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

func (*StringFlag) Apply

go
func (f *StringFlag) Apply(set *FlagSet)

Apply implements of Flag Apply function.

type UintFlag

UintFlag is an uint flag implements of Flag interface.

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

func (*UintFlag) Apply

go
func (f *UintFlag) Apply(set *FlagSet)

Apply implements of Flag Apply function.

Generated by gomarkdoc