Versions in this module Expand all Collapse all v1 v1.0.2 Nov 28, 2021 v1.0.1 Nov 28, 2021 Changes in this version + const CtxKeyParser + func BuildOptions(m map[string]string, prefix ...string) string + func ContainsOpt(name string) bool + func GetArg(index int, def ...string) *gvar.Var + func GetArgAll() []string + func GetOpt(name string, def ...string) *gvar.Var + func GetOptAll() map[string]string + func GetOptWithEnv(key string, def ...interface{}) *gvar.Var + func Init(args ...string) + func Scan(info ...interface{}) string + func Scanf(format string, info ...interface{}) string + type Command struct + Additional string + Brief string + Description string + Examples string + Func Function + FuncWithValue FuncWithValue + HelpFunc Function + Name string + Options []Option + Strict bool + Usage string + func NewFromObject(object interface{}) (rootCmd Command, err error) + func (c *Command) AddCommand(commands ...Command) error + func (c *Command) AddObject(objects ...interface{}) error + func (c *Command) Print() + func (c *Command) Run(ctx context.Context) error + func (c *Command) RunWithValue(ctx context.Context) (value interface{}, err error) + type FuncWithValue func(ctx context.Context, parser *Parser) (out interface{}, err error) + type Function func(ctx context.Context, parser *Parser) (err error) + type Option struct + Brief string + Name string + Orphan bool + Short string + type Parser struct + func Parse(supportedOptions map[string]bool, strict ...bool) (*Parser, error) + func ParseWithArgs(args []string, supportedOptions map[string]bool, strict ...bool) (*Parser, error) + func ParserFromCtx(ctx context.Context) *Parser + func (p *Parser) AutoRun() error + func (p *Parser) BindHandle(cmd string, f func()) error + func (p *Parser) BindHandleMap(m map[string]func()) error + func (p *Parser) ContainsOpt(name string) bool + func (p *Parser) GetArg(index int, def ...string) *gvar.Var + func (p *Parser) GetArgAll() []string + func (p *Parser) GetOpt(name string, def ...interface{}) *gvar.Var + func (p *Parser) GetOptAll() map[string]string + func (p *Parser) MarshalJSON() ([]byte, error) + func (p *Parser) RunHandle(cmd string) error