Documentation
¶
Index ¶
- Constants
- 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 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) ArgCount() int
- func (c *Command) Argument(count int, call ValidFunc)
- 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) Name() string
- func (c *Command) Next() []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 IOArgsGetter, 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 IOArgsGetter
- type ValidFunc
Constants ¶
View Source
const ( ANSI_RESET = "\u001B[0m" ANSI_BLACK = "\u001B[30m" ANSI_RED = "\u001B[31m" ANSI_GREEN = "\u001B[32m" ANSI_YELLOW = "\u001B[33m" ANSI_BLUE = "\u001B[34m" ANSI_PURPLE = "\u001B[35m" ANSI_CYAN = "\u001B[36m" )
nolint: golint
Variables ¶
This section is empty.
Functions ¶
func FatalIfErr ¶
Types ¶
type Argument ¶
func NewArgument ¶
func NewArgument() *Argument
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
func (*Command) AddCommand ¶
func (c *Command) AddCommand(getter ...CommandGetter)
func (*Command) Description ¶
func (*Command) Flag ¶
func (c *Command) Flag(cb func(FlagsSetter))
func (*Command) Flags ¶
func (c *Command) Flags() FlagsGetter
func (*Command) Next ¶
func (c *Command) Next() []CommandGetter
type CommandGetter ¶
type CommandGetter interface {
Next() []CommandGetter
Validate() error
Is(string) bool
Name() string
Description() string
Examples() []string
ArgCount() int
ArgCall(d []string) ([]string, error)
Flags() FlagsGetter
Call() interface{}
AddCommand(...CommandGetter)
}
func NewCommand ¶
func NewCommand(cb func(CommandSetter)) CommandGetter
type CommandSetter ¶
type CommandSetter interface {
Setup(string, string)
Example(string)
Flag(cb func(FlagsSetter))
Argument(count int, 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)
type Flags ¶
type Flags struct {
// contains filtered or unexported fields
}
func (*Flags) Call ¶
func (f *Flags) Call(g IOArgsGetter, cb func(interface{})) error
type FlagsGetter ¶
type FlagsGetter interface {
Info(cb func(bool, string, interface{}, string))
Call(g IOArgsGetter, cb func(interface{})) error
}
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)
}
Click to show internal directories.
Click to hide internal directories.