arg

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2023 License: MIT Imports: 7 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadConfig

func ReadConfig(arg *Arg, opts ...Options)

Types

type Arg

type Arg struct {
	FlagSet *flag.FlagSet
	// contains filtered or unexported fields
}

func NewArg

func NewArg(name string, args []string) *Arg

func (*Arg) AddCallBack

func (a *Arg) AddCallBack(f func())

Parse 执行后,自动执行所有添加的callback

func (*Arg) Bool

func (a *Arg) Bool(defaultValue *bool, name string, usage string)

func (*Arg) Duration

func (a *Arg) Duration(defaultValue *time.Duration, name string, usage string)

func (*Arg) Float64

func (a *Arg) Float64(defaultValue *float64, name string, usage string)

func (*Arg) Int

func (a *Arg) Int(defaultValue *int, name string, usage string)

func (*Arg) Int64

func (a *Arg) Int64(defaultValue *int64, name string, usage string)

func (*Arg) Parse

func (a *Arg) Parse()

func (*Arg) ParseErr added in v0.2.0

func (a *Arg) ParseErr() error

func (*Arg) String

func (a *Arg) String(defaultValue *string, name string, usage string)

func (*Arg) Uint

func (a *Arg) Uint(defaultValue *uint, name string, usage string)

func (*Arg) Uint64

func (a *Arg) Uint64(defaultValue *uint64, name string, usage string)

type Options

type Options func(o *option)

func Name

func Name(v string) Options

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL