Versions in this module Expand all Collapse all v1 v1.1.0 Aug 26, 2020 v1.0.0 Aug 16, 2020 Changes in this version + const Dash + const DashDash + const EndOfArguments + const EndOfOptions + const ExtraParameter + const Failure + const InProgress + const Invalid + const MissingParameter + const NoError + const Terminated + const Unknown + const UnknownOption + var CommandLine = New() + var DisplayWidth = 80 + var HelpColumn = 20 + func AddOption(o Option) + func Arg(n int) string + func Args() []string + func Bool(name rune, helpvalue ...string) *bool + func BoolLong(name string, short rune, helpvalue ...string) *bool + func Counter(name rune, helpvalue ...string) *int + func CounterLong(name string, short rune, helpvalue ...string) *int + func Duration(name rune, value time.Duration, helpvalue ...string) *time.Duration + func DurationLong(name string, short rune, value time.Duration, helpvalue ...string) *time.Duration + func Enum(name rune, values []string, helpvalue ...string) *string + func EnumLong(name string, short rune, values []string, helpvalue ...string) *string + func GetCount(name interface{}) int + func GetValue(name interface{}) string + func Getopt(fn func(Option) bool) error + func Int(name rune, value int, helpvalue ...string) *int + func Int16(name rune, value int16, helpvalue ...string) *int16 + func Int16Long(name string, short rune, value int16, helpvalue ...string) *int16 + func Int32(name rune, value int32, helpvalue ...string) *int32 + func Int32Long(name string, short rune, value int32, helpvalue ...string) *int32 + func Int64(name rune, value int64, helpvalue ...string) *int64 + func Int64Long(name string, short rune, value int64, helpvalue ...string) *int64 + func IntLong(name string, short rune, value int, helpvalue ...string) *int + func IsSet(name interface{}) bool + func List(name rune, helpvalue ...string) *[]string + func ListLong(name string, short rune, helpvalue ...string) *[]string + func NArgs() int + func Parse() + func PrintUsage(w io.Writer) + func Reset() + func SetParameters(parameters string) + func SetProgram(program string) + func SetUsage(usage func()) + func Signed(name rune, value int64, l *SignedLimit, helpvalue ...string) *int64 + func SignedLong(name string, short rune, value int64, l *SignedLimit, helpvalue ...string) *int64 + func String(name rune, value string, helpvalue ...string) *string + func StringLong(name string, short rune, value string, helpvalue ...string) *string + func Uint(name rune, value uint, helpvalue ...string) *uint + func Uint16(name rune, value uint16, helpvalue ...string) *uint16 + func Uint16Long(name string, short rune, value uint16, helpvalue ...string) *uint16 + func Uint32(name rune, value uint32, helpvalue ...string) *uint32 + func Uint32Long(name string, short rune, value uint32, helpvalue ...string) *uint32 + func Uint64(name rune, value uint64, helpvalue ...string) *uint64 + func Uint64Long(name string, short rune, value uint64, helpvalue ...string) *uint64 + func UintLong(name string, short rune, value uint, helpvalue ...string) *uint + func Unsigned(name rune, value uint64, l *UnsignedLimit, helpvalue ...string) *uint64 + func UnsignedLong(name string, short rune, value uint64, l *UnsignedLimit, helpvalue ...string) *uint64 + func Usage() + func Visit(fn func(Option)) + func VisitAll(fn func(Option)) + type Error struct + Err error + Name string + Parameter string + func (i *Error) Error() string + type ErrorCode int + func (e ErrorCode) String() string + type Option interface + Count func() int + IsFlag func() bool + Name func() string + Reset func() + Seen func() bool + SetFlag func() Option + SetOptional func() Option + String func() string + Value func() Value + func BoolVar(p *bool, name rune, helpvalue ...string) Option + func BoolVarLong(p *bool, name string, short rune, helpvalue ...string) Option + func CounterVar(p *int, name rune, helpvalue ...string) Option + func CounterVarLong(p *int, name string, short rune, helpvalue ...string) Option + func DurationVar(p *time.Duration, name rune, helpvalue ...string) Option + func DurationVarLong(p *time.Duration, name string, short rune, helpvalue ...string) Option + func EnumVar(p *string, name rune, values []string, helpvalue ...string) Option + func EnumVarLong(p *string, name string, short rune, values []string, helpvalue ...string) Option + func Int16Var(p *int16, name rune, helpvalue ...string) Option + func Int16VarLong(p *int16, name string, short rune, helpvalue ...string) Option + func Int32Var(p *int32, name rune, helpvalue ...string) Option + func Int32VarLong(p *int32, name string, short rune, helpvalue ...string) Option + func Int64Var(p *int64, name rune, helpvalue ...string) Option + func Int64VarLong(p *int64, name string, short rune, helpvalue ...string) Option + func IntVar(p *int, name rune, helpvalue ...string) Option + func IntVarLong(p *int, name string, short rune, helpvalue ...string) Option + func ListVar(p *[]string, name rune, helpvalue ...string) Option + func ListVarLong(p *[]string, name string, short rune, helpvalue ...string) Option + func Lookup(name interface{}) Option + func SignedVar(p *int64, name rune, l *SignedLimit, helpvalue ...string) Option + func SignedVarLong(p *int64, name string, short rune, l *SignedLimit, helpvalue ...string) Option + func StringVar(p *string, name rune, helpvalue ...string) Option + func StringVarLong(p *string, name string, short rune, helpvalue ...string) Option + func Uint16Var(p *uint16, name rune, helpvalue ...string) Option + func Uint16VarLong(p *uint16, name string, short rune, helpvalue ...string) Option + func Uint32Var(p *uint32, name rune, helpvalue ...string) Option + func Uint32VarLong(p *uint32, name string, short rune, helpvalue ...string) Option + func Uint64Var(p *uint64, name rune, helpvalue ...string) Option + func Uint64VarLong(p *uint64, name string, short rune, helpvalue ...string) Option + func UintVar(p *uint, name rune, helpvalue ...string) Option + func UintVarLong(p *uint, name string, short rune, helpvalue ...string) Option + func UnsignedVar(p *uint64, name rune, l *UnsignedLimit, helpvalue ...string) Option + func UnsignedVarLong(p *uint64, name string, short rune, l *UnsignedLimit, helpvalue ...string) Option + func Var(p Value, name rune, helpvalue ...string) Option + func VarLong(p Value, name string, short rune, helpvalue ...string) Option + type Set struct + func New() *Set + func (s *Set) AddOption(o Option) + func (s *Set) Arg(n int) string + func (s *Set) Args() []string + func (s *Set) Bool(name rune, helpvalue ...string) *bool + func (s *Set) BoolLong(name string, short rune, helpvalue ...string) *bool + func (s *Set) BoolVar(p *bool, name rune, helpvalue ...string) Option + func (s *Set) BoolVarLong(p *bool, name string, short rune, helpvalue ...string) Option + func (s *Set) Counter(name rune, helpvalue ...string) *int + func (s *Set) CounterLong(name string, short rune, helpvalue ...string) *int + func (s *Set) CounterVar(p *int, name rune, helpvalue ...string) Option + func (s *Set) CounterVarLong(p *int, name string, short rune, helpvalue ...string) Option + func (s *Set) Duration(name rune, value time.Duration, helpvalue ...string) *time.Duration + func (s *Set) DurationLong(name string, short rune, value time.Duration, helpvalue ...string) *time.Duration + func (s *Set) DurationVar(p *time.Duration, name rune, helpvalue ...string) Option + func (s *Set) DurationVarLong(p *time.Duration, name string, short rune, helpvalue ...string) Option + func (s *Set) Enum(name rune, values []string, helpvalue ...string) *string + func (s *Set) EnumLong(name string, short rune, values []string, helpvalue ...string) *string + func (s *Set) EnumVar(p *string, name rune, values []string, helpvalue ...string) Option + func (s *Set) EnumVarLong(p *string, name string, short rune, values []string, helpvalue ...string) Option + func (s *Set) GetCount(name interface{}) int + func (s *Set) GetValue(name interface{}) string + func (s *Set) Getopt(args []string, fn func(Option) bool) (err error) + func (s *Set) Int(name rune, value int, helpvalue ...string) *int + func (s *Set) Int16(name rune, value int16, helpvalue ...string) *int16 + func (s *Set) Int16Long(name string, short rune, value int16, helpvalue ...string) *int16 + func (s *Set) Int16Var(p *int16, name rune, helpvalue ...string) Option + func (s *Set) Int16VarLong(p *int16, name string, short rune, helpvalue ...string) Option + func (s *Set) Int32(name rune, value int32, helpvalue ...string) *int32 + func (s *Set) Int32Long(name string, short rune, value int32, helpvalue ...string) *int32 + func (s *Set) Int32Var(p *int32, name rune, helpvalue ...string) Option + func (s *Set) Int32VarLong(p *int32, name string, short rune, helpvalue ...string) Option + func (s *Set) Int64(name rune, value int64, helpvalue ...string) *int64 + func (s *Set) Int64Long(name string, short rune, value int64, helpvalue ...string) *int64 + func (s *Set) Int64Var(p *int64, name rune, helpvalue ...string) Option + func (s *Set) Int64VarLong(p *int64, name string, short rune, helpvalue ...string) Option + func (s *Set) IntLong(name string, short rune, value int, helpvalue ...string) *int + func (s *Set) IntVar(p *int, name rune, helpvalue ...string) Option + func (s *Set) IntVarLong(p *int, name string, short rune, helpvalue ...string) Option + func (s *Set) IsSet(name interface{}) bool + func (s *Set) List(name rune, helpvalue ...string) *[]string + func (s *Set) ListLong(name string, short rune, helpvalue ...string) *[]string + func (s *Set) ListVar(p *[]string, name rune, helpvalue ...string) Option + func (s *Set) ListVarLong(p *[]string, name string, short rune, helpvalue ...string) Option + func (s *Set) Lookup(name interface{}) Option + func (s *Set) NArgs() int + func (s *Set) Parse(args []string) + func (s *Set) PrintOptions(w io.Writer) + func (s *Set) PrintUsage(w io.Writer) + func (s *Set) Reset() + func (s *Set) SetParameters(parameters string) + func (s *Set) SetProgram(program string) + func (s *Set) SetUsage(usage func()) + func (s *Set) Signed(name rune, value int64, l *SignedLimit, helpvalue ...string) *int64 + func (s *Set) SignedLong(name string, short rune, value int64, l *SignedLimit, helpvalue ...string) *int64 + func (s *Set) SignedVar(p *int64, name rune, l *SignedLimit, helpvalue ...string) Option + func (s *Set) SignedVarLong(p *int64, name string, short rune, l *SignedLimit, helpvalue ...string) Option + func (s *Set) String(name rune, value string, helpvalue ...string) *string + func (s *Set) StringLong(name string, short rune, value string, helpvalue ...string) *string + func (s *Set) StringVar(p *string, name rune, helpvalue ...string) Option + func (s *Set) StringVarLong(p *string, name string, short rune, helpvalue ...string) Option + func (s *Set) Uint(name rune, value uint, helpvalue ...string) *uint + func (s *Set) Uint16(name rune, value uint16, helpvalue ...string) *uint16 + func (s *Set) Uint16Long(name string, short rune, value uint16, helpvalue ...string) *uint16 + func (s *Set) Uint16Var(p *uint16, name rune, helpvalue ...string) Option + func (s *Set) Uint16VarLong(p *uint16, name string, short rune, helpvalue ...string) Option + func (s *Set) Uint32(name rune, value uint32, helpvalue ...string) *uint32 + func (s *Set) Uint32Long(name string, short rune, value uint32, helpvalue ...string) *uint32 + func (s *Set) Uint32Var(p *uint32, name rune, helpvalue ...string) Option + func (s *Set) Uint32VarLong(p *uint32, name string, short rune, helpvalue ...string) Option + func (s *Set) Uint64(name rune, value uint64, helpvalue ...string) *uint64 + func (s *Set) Uint64Long(name string, short rune, value uint64, helpvalue ...string) *uint64 + func (s *Set) Uint64Var(p *uint64, name rune, helpvalue ...string) Option + func (s *Set) Uint64VarLong(p *uint64, name string, short rune, helpvalue ...string) Option + func (s *Set) UintLong(name string, short rune, value uint, helpvalue ...string) *uint + func (s *Set) UintVar(p *uint, name rune, helpvalue ...string) Option + func (s *Set) UintVarLong(p *uint, name string, short rune, helpvalue ...string) Option + func (s *Set) Unsigned(name rune, value uint64, l *UnsignedLimit, helpvalue ...string) *uint64 + func (s *Set) UnsignedLong(name string, short rune, value uint64, l *UnsignedLimit, helpvalue ...string) *uint64 + func (s *Set) UnsignedVar(p *uint64, name rune, l *UnsignedLimit, helpvalue ...string) Option + func (s *Set) UnsignedVarLong(p *uint64, name string, short rune, l *UnsignedLimit, helpvalue ...string) Option + func (s *Set) Var(p Value, name rune, helpvalue ...string) Option + func (s *Set) VarLong(p Value, name string, short rune, helpvalue ...string) Option + func (s *Set) Visit(fn func(Option)) + func (s *Set) VisitAll(fn func(Option)) + type SignedLimit struct + Base int + Bits int + Max int64 + Min int64 + type State int + type UnsignedLimit struct + Base int + Bits int + Max uint64 + Min uint64 + type Value interface + Set func(string, Option) error + String func() string Other modules containing this package github.com/pborman/getopt/v2