Documentation ¶
Index ¶
- func AddHandler(pattern string, groups FlagGroups, callback func(Context), desc string)
- func Handle(args []string) bool
- func SetHandlers(h []*Handler)
- type Arguments
- type BoolFlag
- type BoolFlagParser
- type CaptureGroupParser
- type CompleteParser
- type Context
- type EqualParser
- type Flag
- type FlagGroup
- type FlagGroups
- type FlagParser
- type Handler
- type IntFlag
- type IntFlagParser
- type Parser
- type ShortCircuitParser
- type StringFlag
- type StringFlagParser
- type StringSliceFlag
- type StringSliceFlagParser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddHandler ¶
func AddHandler(pattern string, groups FlagGroups, callback func(Context), desc string)
func SetHandlers ¶
func SetHandlers(h []*Handler)
Types ¶
type BoolFlag ¶
type BoolFlag struct { Patterns []string Name string Description string DefaultValue bool OmitValue bool }
func (BoolFlag) GetDescription ¶
func (BoolFlag) GetPatterns ¶
type BoolFlagParser ¶
type BoolFlagParser struct {
// contains filtered or unexported fields
}
func (BoolFlagParser) Capture ¶
func (self BoolFlagParser) Capture(values []string) ([]string, map[string]interface{})
func (BoolFlagParser) String ¶
func (self BoolFlagParser) String() string
type CaptureGroupParser ¶
type CaptureGroupParser struct {
// contains filtered or unexported fields
}
func (CaptureGroupParser) Capture ¶
func (self CaptureGroupParser) Capture(values []string) ([]string, map[string]interface{})
func (CaptureGroupParser) Match ¶
func (self CaptureGroupParser) Match(values []string) ([]string, bool)
func (CaptureGroupParser) String ¶
func (self CaptureGroupParser) String() string
type CompleteParser ¶
type CompleteParser struct {
// contains filtered or unexported fields
}
func (CompleteParser) Capture ¶
func (self CompleteParser) Capture(values []string) ([]string, map[string]interface{})
func (CompleteParser) String ¶
func (self CompleteParser) String() string
type EqualParser ¶
type EqualParser struct {
// contains filtered or unexported fields
}
func (EqualParser) Capture ¶
func (self EqualParser) Capture(values []string) ([]string, map[string]interface{})
func (EqualParser) String ¶
func (self EqualParser) String() string
type FlagGroup ¶
func NewFlagGroup ¶
type FlagGroups ¶
type FlagGroups []FlagGroup
type FlagParser ¶
type FlagParser struct {
// contains filtered or unexported fields
}
func (FlagParser) Capture ¶
func (self FlagParser) Capture(values []string) ([]string, map[string]interface{})
func (FlagParser) String ¶
func (self FlagParser) String() string
type Handler ¶
type Handler struct { Pattern string FlagGroups FlagGroups Callback func(Context) Description string }
func (*Handler) SplitPattern ¶
Split on spaces but ignore spaces inside <...> and [...]
type IntFlagParser ¶
type IntFlagParser struct {
// contains filtered or unexported fields
}
func (IntFlagParser) Capture ¶
func (self IntFlagParser) Capture(values []string) ([]string, map[string]interface{})
func (IntFlagParser) String ¶
func (self IntFlagParser) String() string
type ShortCircuitParser ¶
type ShortCircuitParser struct {
// contains filtered or unexported fields
}
func (ShortCircuitParser) Capture ¶
func (self ShortCircuitParser) Capture(values []string) ([]string, map[string]interface{})
func (ShortCircuitParser) Match ¶
func (self ShortCircuitParser) Match(values []string) ([]string, bool)
func (ShortCircuitParser) String ¶
func (self ShortCircuitParser) String() string
type StringFlag ¶
func (StringFlag) GetDescription ¶
func (self StringFlag) GetDescription() string
func (StringFlag) GetName ¶
func (self StringFlag) GetName() string
func (StringFlag) GetParser ¶
func (self StringFlag) GetParser() Parser
func (StringFlag) GetPatterns ¶
func (self StringFlag) GetPatterns() []string
type StringFlagParser ¶
type StringFlagParser struct {
// contains filtered or unexported fields
}
func (StringFlagParser) Capture ¶
func (self StringFlagParser) Capture(values []string) ([]string, map[string]interface{})
func (StringFlagParser) Match ¶
func (self StringFlagParser) Match(values []string) ([]string, bool)
func (StringFlagParser) String ¶
func (self StringFlagParser) String() string
type StringSliceFlag ¶
type StringSliceFlag struct { Patterns []string Name string Description string DefaultValue []string }
func (StringSliceFlag) GetDescription ¶
func (self StringSliceFlag) GetDescription() string
func (StringSliceFlag) GetName ¶
func (self StringSliceFlag) GetName() string
func (StringSliceFlag) GetParser ¶
func (self StringSliceFlag) GetParser() Parser
func (StringSliceFlag) GetPatterns ¶
func (self StringSliceFlag) GetPatterns() []string
type StringSliceFlagParser ¶
type StringSliceFlagParser struct {
// contains filtered or unexported fields
}
func (StringSliceFlagParser) Capture ¶
func (self StringSliceFlagParser) Capture(values []string) ([]string, map[string]interface{})
func (StringSliceFlagParser) Match ¶
func (self StringSliceFlagParser) Match(values []string) ([]string, bool)
func (StringSliceFlagParser) String ¶
func (self StringSliceFlagParser) String() string
Click to show internal directories.
Click to hide internal directories.