Documentation
¶
Index ¶
- func Help(c *Context) error
- func IsTerminal(f *os.File) bool
- type CmdExecutor
- type Command
- type CommandOptions
- type Context
- func (c *Context) Arg(i int) string
- func (c *Context) Bool(name string) bool
- func (c *Context) Error(err error) error
- func (c *Context) Errorf(format string, args ...interface{}) error
- func (c *Context) Execute(cmd string, args ...string) ([]byte, error)
- func (c *Context) Fail(err error)
- func (c *Context) Flag(name string) *Flag
- func (c *Context) Info() *Info
- func (c *Context) Int(name string) int
- func (c *Context) LocalSetting(name string) string
- func (c *Context) OK(id ...string) error
- func (c *Context) Options(opts interface{}) error
- func (c *Context) Read(data []byte) (int, error)
- func (c *Context) ReadSecret() (string, error)
- func (c *Context) Reader() *Reader
- func (c *Context) Run(cmd string, args ...string) error
- func (c *Context) SettingDelete(name string) error
- func (c *Context) SettingDirectory(name string) (string, error)
- func (c *Context) SettingRead(name string) (string, error)
- func (c *Context) SettingReadKey(name, key string) (string, error)
- func (c *Context) SettingWrite(name, value string) error
- func (c *Context) SettingWriteKey(name, key, value string) error
- func (c *Context) Startf(format string, args ...interface{})
- func (c *Context) String(name string) string
- func (c *Context) Table(columns ...string) *Table
- func (c *Context) Terminal(cmd string, args ...string) error
- func (c *Context) TerminalRaw() func()
- func (c *Context) TerminalSize() (int, int, error)
- func (c *Context) Value(name string) interface{}
- func (c *Context) Version() string
- func (c *Context) Write(data []byte) (int, error)
- func (c *Context) Writef(format string, args ...interface{}) error
- func (c *Context) Writer() *Writer
- type Engine
- func (e *Engine) Command(command, description string, fn HandlerFunc, opts CommandOptions)
- func (e *Engine) Execute(args []string) int
- func (e *Engine) ExecuteContext(ctx context.Context, args []string) int
- func (e *Engine) LocalSetting(name string) string
- func (e *Engine) SettingDelete(name string) error
- func (e *Engine) SettingDirectory(name string) (string, error)
- func (e *Engine) SettingRead(name string) (string, error)
- func (e *Engine) SettingReadKey(name, key string) (string, error)
- func (e *Engine) SettingWrite(name, value string) error
- func (e *Engine) SettingWriteKey(name, key, value string) error
- type Executor
- type ExitCode
- type ExitCoder
- type Flag
- type HandlerFunc
- type Info
- type InfoRow
- type Reader
- type Renderer
- type Table
- type Validator
- type Writer
- func (w *Writer) Error(err error) error
- func (w *Writer) Errorf(format string, args ...interface{}) error
- func (w *Writer) IsTerminal() bool
- func (w *Writer) Sprintf(format string, args ...interface{}) string
- func (w *Writer) Write(data []byte) (int, error)
- func (w *Writer) Writef(format string, args ...interface{}) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTerminal ¶
Types ¶
type CmdExecutor ¶
type CmdExecutor struct {
}
type Command ¶
type Command struct {
Command []string
Description string
Flags []Flag
Invisible bool
Handler HandlerFunc
Usage string
Validate Validator
// contains filtered or unexported fields
}
func (*Command) ExecuteContext ¶
func (*Command) FullCommand ¶
type CommandOptions ¶
type Context ¶
type Context struct {
context.Context
Args []string
Flags []*Flag
// contains filtered or unexported fields
}
func (*Context) LocalSetting ¶
func (*Context) ReadSecret ¶
func (*Context) SettingDelete ¶
func (*Context) SettingWrite ¶
func (*Context) SettingWriteKey ¶
func (*Context) TerminalRaw ¶
func (c *Context) TerminalRaw() func()
type Engine ¶
type Engine struct {
Commands []Command
Executor Executor
Name string
Profile string
Reader *Reader
Settings string
Version string
Writer *Writer
}
func (*Engine) Command ¶
func (e *Engine) Command(command, description string, fn HandlerFunc, opts CommandOptions)
func (*Engine) ExecuteContext ¶
func (*Engine) LocalSetting ¶
func (*Engine) SettingDelete ¶
func (*Engine) SettingWrite ¶
func (*Engine) SettingWriteKey ¶
type Flag ¶
type Flag struct {
Default interface{}
Description string
Name string
Short string
Value interface{}
// contains filtered or unexported fields
}
func DurationFlag ¶
func OptionFlags ¶
func OptionFlags(opts interface{}) []Flag
func StringFlag ¶
func (*Flag) UsageShort ¶
type HandlerFunc ¶
type Reader ¶
var (
DefaultReader *Reader
)
func (*Reader) IsTerminal ¶
func (*Reader) TerminalRaw ¶
type Validator ¶
func ArgsBetween ¶
Click to show internal directories.
Click to hide internal directories.