Versions in this module Expand all Collapse all v1 v1.23.2 Aug 18, 2026 v1.23.1 Aug 17, 2026 v1.23.0 Aug 17, 2026 v1.22.0 Aug 17, 2026 Changes in this version + func WithChoices[T interface{ ... }](opt T, choices ...string) T + func WithDefault[T interface{ ... }](opt T, value string) T + func WithMetavar[T interface{ ... }](opt T, metavar string) T + func WithNargs[T interface{ ... }](opt T, nargs Nargs) T + func WithOptionalArgument[T interface{ ... }](opt T, constValue string) T + type BoolOption struct + Value *bool + func NewBoolOption(shortName rune, longName string, usage string, required bool, value *bool) *BoolOption + func (base *BoolOption) GetChoices() []string + func (base *BoolOption) GetConst() string + func (base *BoolOption) GetDefault() *string + func (base *BoolOption) GetLongName() string + func (base *BoolOption) GetMetavar() string + func (base *BoolOption) GetNargs() Nargs + func (base *BoolOption) GetRequired() bool + func (base *BoolOption) GetShortName() string + func (base *BoolOption) GetUsage() string + func (base *BoolOption) SetChoices(choices ...string) + func (base *BoolOption) SetConst(value string) + func (base *BoolOption) SetDefault(value string) + func (base *BoolOption) SetMetavar(metavar string) + func (base *BoolOption) SetNargs(nargs Nargs) + func (boolOption *BoolOption) Set(_ string) error + type ChoiceNormalizer interface + NormalizeChoice func(string) (string, error) + type ChoicesProvider interface + GetChoices func() []string + type ConstProvider interface + GetConst func() string + type CountedOption struct + Count *int + func NewCountedOption(shortName rune, longName string, usage string, required bool, count *int) *CountedOption + func (base *CountedOption) GetChoices() []string + func (base *CountedOption) GetConst() string + func (base *CountedOption) GetDefault() *string + func (base *CountedOption) GetLongName() string + func (base *CountedOption) GetMetavar() string + func (base *CountedOption) GetNargs() Nargs + func (base *CountedOption) GetRequired() bool + func (base *CountedOption) GetShortName() string + func (base *CountedOption) GetUsage() string + func (base *CountedOption) SetChoices(choices ...string) + func (base *CountedOption) SetConst(value string) + func (base *CountedOption) SetDefault(value string) + func (base *CountedOption) SetMetavar(metavar string) + func (base *CountedOption) SetNargs(nargs Nargs) + func (countedOption *CountedOption) Set(_ string) error + type DefaultProvider interface + GetDefault func() *string + type FileOption struct + File *os.File + Flag int + Mode os.FileMode + func NewFileOption(shortName rune, longName string, usage string, required bool, file *os.File) *FileOption + func NewFileOptionExtra(shortName rune, longName string, usage string, required bool, flag int, ...) *FileOption + func (base *FileOption) GetChoices() []string + func (base *FileOption) GetConst() string + func (base *FileOption) GetDefault() *string + func (base *FileOption) GetLongName() string + func (base *FileOption) GetMetavar() string + func (base *FileOption) GetNargs() Nargs + func (base *FileOption) GetRequired() bool + func (base *FileOption) GetShortName() string + func (base *FileOption) GetUsage() string + func (base *FileOption) SetChoices(choices ...string) + func (base *FileOption) SetConst(value string) + func (base *FileOption) SetDefault(value string) + func (base *FileOption) SetMetavar(metavar string) + func (base *FileOption) SetNargs(nargs Nargs) + func (fileOption *FileOption) Set(in string) error + type IntOption struct + Value *int + func NewIntOption(shortName rune, longName string, usage string, required bool, value *int) *IntOption + func (base *IntOption) GetChoices() []string + func (base *IntOption) GetConst() string + func (base *IntOption) GetDefault() *string + func (base *IntOption) GetLongName() string + func (base *IntOption) GetMetavar() string + func (base *IntOption) GetNargs() Nargs + func (base *IntOption) GetRequired() bool + func (base *IntOption) GetShortName() string + func (base *IntOption) GetUsage() string + func (base *IntOption) SetChoices(choices ...string) + func (base *IntOption) SetConst(value string) + func (base *IntOption) SetDefault(value string) + func (base *IntOption) SetMetavar(metavar string) + func (base *IntOption) SetNargs(nargs Nargs) + func (intOption *IntOption) NormalizeChoice(in string) (string, error) + func (intOption *IntOption) Set(in string) error + type IntsOption struct + Value *[]int + func NewIntsOption(shortName rune, longName string, usage string, required bool, value *[]int) *IntsOption + func (base *IntsOption) GetChoices() []string + func (base *IntsOption) GetConst() string + func (base *IntsOption) GetDefault() *string + func (base *IntsOption) GetLongName() string + func (base *IntsOption) GetMetavar() string + func (base *IntsOption) GetNargs() Nargs + func (base *IntsOption) GetRequired() bool + func (base *IntsOption) GetShortName() string + func (base *IntsOption) GetUsage() string + func (base *IntsOption) SetChoices(choices ...string) + func (base *IntsOption) SetConst(value string) + func (base *IntsOption) SetDefault(value string) + func (base *IntsOption) SetMetavar(metavar string) + func (base *IntsOption) SetNargs(nargs Nargs) + func (intsOption *IntsOption) NormalizeChoice(in string) (string, error) + func (intsOption *IntsOption) Set(in string) error + type Nargs string + const NargsAny + const NargsAtLeastOne + const NargsNone + const NargsOne + const NargsOptional + func (nargs Nargs) IsVariadic() bool + func (nargs Nargs) Minimum() int + type Option interface + GetLongName func() string + GetMetavar func() string + GetNargs func() Nargs + GetRequired func() bool + GetShortName func() string + GetUsage func() string + Set func(string) error + type StringOption struct + Value *string + func NewStringOption(shortName rune, longName string, usage string, required bool, value *string) *StringOption + func (base *StringOption) GetChoices() []string + func (base *StringOption) GetConst() string + func (base *StringOption) GetDefault() *string + func (base *StringOption) GetLongName() string + func (base *StringOption) GetMetavar() string + func (base *StringOption) GetNargs() Nargs + func (base *StringOption) GetRequired() bool + func (base *StringOption) GetShortName() string + func (base *StringOption) GetUsage() string + func (base *StringOption) SetChoices(choices ...string) + func (base *StringOption) SetConst(value string) + func (base *StringOption) SetDefault(value string) + func (base *StringOption) SetMetavar(metavar string) + func (base *StringOption) SetNargs(nargs Nargs) + func (stringOption *StringOption) Set(in string) error + type StringsOption struct + Value *[]string + func NewStringsOption(shortName rune, longName string, usage string, required bool, value *[]string) *StringsOption + func (base *StringsOption) GetChoices() []string + func (base *StringsOption) GetConst() string + func (base *StringsOption) GetDefault() *string + func (base *StringsOption) GetLongName() string + func (base *StringsOption) GetMetavar() string + func (base *StringsOption) GetNargs() Nargs + func (base *StringsOption) GetRequired() bool + func (base *StringsOption) GetShortName() string + func (base *StringsOption) GetUsage() string + func (base *StringsOption) SetChoices(choices ...string) + func (base *StringsOption) SetConst(value string) + func (base *StringsOption) SetDefault(value string) + func (base *StringsOption) SetMetavar(metavar string) + func (base *StringsOption) SetNargs(nargs Nargs) + func (stringsOption *StringsOption) Set(in string) error