Documentation ¶
Index ¶
- Constants
- func UsageFunc(groups ...*Group) func() string
- type Flag
- type FlagOption
- type FlagSet
- func (f *FlagSet) Args() []string
- func (f *FlagSet) Bool(p *bool, name, usage string, opts ...FlagOption)
- func (f *FlagSet) FixedStrings(p *[]string, name, usage string, opts ...FlagOption)
- func (f *FlagSet) FlexStrings(p *[]string, name, usage string, opts ...FlagOption)
- func (f *FlagSet) Lookup(name string) *Flag
- func (f *FlagSet) MultipleFlagFixedStrings(p *[][2]string, name, usage string, opts ...FlagOption)
- func (f *FlagSet) MultipleFlagString(p *[]string, name, usage string, opts ...FlagOption)
- func (f *FlagSet) NewGroup(name string) *Group
- func (f *FlagSet) Parse(args []string) error
- func (f *FlagSet) String(p *string, name, usage string, opts ...FlagOption)
- func (f *FlagSet) Var(v Value, name, usage string, opts ...FlagOption)
- type FlagType
- type Group
- type Value
- func Bool(p *bool) Value
- func FixedStrings(p *[]string) Value
- func FlagValue[T any](p *T, from func(v string) (T, error)) Value
- func FlagValues[T any](p *T, from func(v string) (T, error), cap func() int) Value
- func FlexStrings(p *[]string) Value
- func MultipleFlagFixedStrings(p *[][2]string) Value
- func MultipleFlagString(p *[]string) Value
- func String(p *string) Value
- type Values
Constants ¶
View Source
const (
CapNoLimit = -1
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FlagOption ¶
type FlagOption func(*Flag)
func WithDenyDuplicate ¶
func WithDenyDuplicate() FlagOption
func WithGroup ¶
func WithGroup(g *Group, typ FlagType) FlagOption
type FlagSet ¶
type FlagSet struct { Usage func() string // contains filtered or unexported fields }
func NewFlagSet ¶
func (*FlagSet) Bool ¶
func (f *FlagSet) Bool(p *bool, name, usage string, opts ...FlagOption)
Bool presents -flag NOT -flag true/false
func (*FlagSet) FixedStrings ¶
func (f *FlagSet) FixedStrings(p *[]string, name, usage string, opts ...FlagOption)
FixedStrings presents `-flag <value1> <value2>` number of values are specified by initialize of a variable e.g. s := []string{make([]string, 2)} This is a reference implementation
func (*FlagSet) FlexStrings ¶
func (f *FlagSet) FlexStrings(p *[]string, name, usage string, opts ...FlagOption)
FlexStrings presents `-flag <value1> <value2> <value3> ...`
func (*FlagSet) MultipleFlagFixedStrings ¶
func (f *FlagSet) MultipleFlagFixedStrings(p *[][2]string, name, usage string, opts ...FlagOption)
MultipleFlagFixedStrings presents `-flag <value1> <value2> -flag <value3> <value4> -flag ...` This is a reference implementation
func (*FlagSet) MultipleFlagString ¶
func (f *FlagSet) MultipleFlagString(p *[]string, name, usage string, opts ...FlagOption)
MultipleFlagString presents `-flag <value1> -flag <value2> -flag <value3>`
type Group ¶
type Group struct { Name string // contains filtered or unexported fields }
func LookupGroup ¶
func (*Group) AddDescription ¶
func (*Group) LookupByType ¶
type Value ¶
func FixedStrings ¶
func FlagValues ¶
func FlexStrings ¶
func MultipleFlagString ¶
Click to show internal directories.
Click to hide internal directories.