Documentation
¶
Index ¶
- Variables
- func AtFile(f *Flag)
- func CheckFlag(f *Flag) error
- func Hidden(f *Flag)
- func Local(f *Flag)
- func ParseArg(arg string, args []string, eatnext, optional bool) (key, val string, nextargs []string, err error)
- func ParseBool(f *Flag, arg string, args []string) ([]string, error)
- func ParseDuration(f *Flag, arg string, args []string) ([]string, error)
- func ParseFloat32(f *Flag, arg string, args []string) ([]string, error)
- func ParseFloat64(f *Flag, arg string, args []string) ([]string, error)
- func ParseInt(f *Flag, arg string, args []string) ([]string, error)
- func ParseInt64(f *Flag, arg string, args []string) ([]string, error)
- func ParseString(f *Flag, arg string, args []string) ([]string, error)
- func ParseStringSlice(f *Flag, arg string, args []string) ([]string, error)
- func ParseUint(f *Flag, arg string, args []string) ([]string, error)
- func ParseUint64(f *Flag, arg string, args []string) ([]string, error)
- func Required(f *Flag)
- type Action
- type Flag
- func (f *Flag) Bool() bool
- func (f *Flag) Duration() time.Duration
- func (f *Flag) Float32() float32
- func (f *Flag) Float64() float64
- func (f *Flag) Int() int
- func (f *Flag) Int64() int64
- func (f *Flag) MainName() string
- func (f *Flag) String() string
- func (f *Flag) Uint() uint
- func (f *Flag) Uint64() uint64
- type Option
- type Setter
- type Visitor
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRequired = errors.New("flag is required") ErrValueRequired = errors.New("flag value is required") )
Functions ¶
func AtFile ¶
func AtFile(f *Flag)
AtFile replaces flag value of the form @file with the file contents.
Types ¶
type Action ¶
func ParseSetter ¶
type Flag ¶
type Flag struct {
Name string
Group string
Usage string
Description string
Help string
Action Action // flag parser
Check Visitor // called after all parsing but before command action for all flags
Hidden bool // not shown in a help by default
Required bool // must be set from args or env var
Local bool // do not inherited by child
IsSet bool
Value interface{}
CurrentCommand interface{}
}
Click to show internal directories.
Click to hide internal directories.