Versions in this module Expand all Collapse all v0 v0.0.1 Aug 17, 2023 Changes in this version + type Action = func(*Object) error + type Arg struct + Desc string + Index int + Name string + Value interface{} + func (c Arg) StringValue() (string, error) + type Args map[string]*Arg + func (c Args) ForIndex(index int) (*Arg, error) + func (c Args) HelpString() string + func (c Args) StringValueForIndex(index int) (string, error) + type Examples []string + func (c Examples) HelpString(appName, cmdName string) string + type Flag struct + Default interface{} + Desc string + Name string + Optional bool + Value interface{} + type Flags map[string]*Flag + func (c Flags) AllBut(ignore ...string) Flags + func (c Flags) BoolValue(flag string) (bool, error) + func (c Flags) DurationValue(flag string) (time.Duration, error) + func (c Flags) GetReflectValue(flag string) (reflect.Value, error) + func (c Flags) GetValue(flag string) (interface{}, error) + func (c Flags) HelpString() string + func (c Flags) Int64Value(flag string) (int64, error) + func (c Flags) IntValue(flag string) (int, error) + func (c Flags) RegexValue(flag string) (*regexp.Regexp, error) + func (c Flags) StringSliceValue(flag string) ([]string, error) + func (c Flags) StringValue(flag string) (string, error) + func (c Flags) TimeValue(flag string) (time.Time, error) + type Object struct + Action Action + App string + Args Args + Context context.Context + Desc string + Examples Examples + Flags Flags + Name string + func New(app, name string, opts ...Option) (*Object, error) + func (c *Object) Help() string + func (c *Object) Run(args []string) int + func (c *Object) Synopsis() string + type Option = func(*Object) error + func WithAction(action Action) Option + func WithArg(index int, name, desc string) Option + func WithContext(ctx context.Context) Option + func WithDescription(desc string) Option + func WithExample(example string) Option + func WithFlag(name, desc string, dflt interface{}) Option v0.0.1-alpha Jan 23, 2021