Documentation ¶
Index ¶
- func Debugf(msg string, args ...interface{})
- func Errorf(msg string, args ...interface{})
- func FatalIfErr(err error, msg string, args ...interface{})
- func Fatalf(msg string, args ...interface{})
- func Infof(msg string, args ...interface{})
- func Input(msg string, vars []string, def string) string
- func InputBool(msg string, def bool) bool
- func Rawf(msg string, args ...interface{})
- func ShowDebug(ok bool)
- func Warnf(msg string, args ...interface{})
- type Arg
- type ArgGetter
- type Args
- type Argument
- type Command
- func (c *Command) AddCommand(getter ...CommandGetter)
- func (c *Command) ArgCall(d []string) ([]string, error)
- func (c *Command) ArgumentFunc(call ValidFunc)
- func (c *Command) AsRoot() CommandGetter
- func (c *Command) Call() interface{}
- func (c *Command) Description() string
- func (c *Command) Example(s string)
- func (c *Command) Examples() []string
- func (c *Command) ExecFunc(i interface{})
- func (c *Command) Flag(cb func(FlagsSetter))
- func (c *Command) Flags() FlagsGetter
- func (c *Command) Is(s string) bool
- func (c *Command) IsRoot() bool
- func (c *Command) List() []CommandGetter
- func (c *Command) Name() string
- func (c *Command) Next(cmd string) CommandGetter
- func (c *Command) Setup(name, description string)
- func (c *Command) Validate() error
- type CommandGetter
- type CommandSetter
- type Console
- type FlagItem
- type Flags
- func (f *Flags) Bool(name string, usage string)
- func (f *Flags) Call(g ArgGetter, cb func(interface{})) error
- func (f *Flags) Count() int
- func (f *Flags) Float(name string, usage string)
- func (f *Flags) FloatVar(name string, value float64, usage string)
- func (f *Flags) Info(cb func(req bool, name string, v interface{}, usage string))
- func (f *Flags) Int(name string, usage string)
- func (f *Flags) IntVar(name string, value int64, usage string)
- func (f *Flags) String(name string, usage string)
- func (f *Flags) StringVar(name string, value string, usage string)
- type FlagsGetter
- type FlagsSetter
- type ValidFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(msg string, args ...interface{})
Debugf console message writer for debug level
func Errorf ¶
func Errorf(msg string, args ...interface{})
Errorf console message writer for error level
func FatalIfErr ¶
FatalIfErr console message writer if err is not nil
func Fatalf ¶
func Fatalf(msg string, args ...interface{})
Fatalf console message writer with exit code 1
func Infof ¶
func Infof(msg string, args ...interface{})
Infof console message writer for info level
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
func (*Command) AddCommand ¶
func (c *Command) AddCommand(getter ...CommandGetter)
func (*Command) ArgumentFunc ¶
func (*Command) AsRoot ¶
func (c *Command) AsRoot() CommandGetter
func (*Command) Description ¶
func (*Command) Flag ¶
func (c *Command) Flag(cb func(FlagsSetter))
func (*Command) Flags ¶
func (c *Command) Flags() FlagsGetter
func (*Command) List ¶
func (c *Command) List() []CommandGetter
func (*Command) Next ¶
func (c *Command) Next(cmd string) CommandGetter
type CommandGetter ¶
type CommandGetter interface { Next(string) CommandGetter List() []CommandGetter Validate() error Is(string) bool Name() string Description() string Examples() []string ArgCall(d []string) ([]string, error) Flags() FlagsGetter Call() interface{} AddCommand(...CommandGetter) AsRoot() CommandGetter IsRoot() bool }
func NewCommand ¶
func NewCommand(cb func(CommandSetter)) CommandGetter
type CommandSetter ¶
type CommandSetter interface { Setup(string, string) Example(string) Flag(cb func(FlagsSetter)) ArgumentFunc(call ValidFunc) ExecFunc(interface{}) AddCommand(...CommandGetter) }
type Console ¶
type Console struct {
// contains filtered or unexported fields
}
func (*Console) AddCommand ¶
func (c *Console) AddCommand(getter ...CommandGetter)
func (*Console) RootCommand ¶
func (c *Console) RootCommand(getter CommandGetter)
type FlagItem ¶
type FlagItem struct {
// contains filtered or unexported fields
}
FlagItem element of flag model
type Flags ¶
type Flags struct {
// contains filtered or unexported fields
}
Flags model
type FlagsGetter ¶
type FlagsGetter interface { Info(cb func(bool, string, interface{}, string)) Call(g ArgGetter, cb func(interface{})) error }
FlagsGetter getter interface
type FlagsSetter ¶
type FlagsSetter interface { StringVar(name string, value string, usage string) String(name string, usage string) IntVar(name string, value int64, usage string) Int(name string, usage string) FloatVar(name string, value float64, usage string) Float(name string, usage string) Bool(name string, usage string) }
FlagsSetter setter interface
Click to show internal directories.
Click to hide internal directories.