Documentation
¶
Index ¶
- Variables
- type Args
- func (a *Args) After(command ...string)
- func (a *Args) AfterFn(fn func() error)
- func (a *Args) AppendParams(params ...string)
- func (a *Args) Before(command ...string)
- func (a *Args) Commands() []*cmd.Cmd
- func (a *Args) FirstParam() string
- func (a *Args) GetParam(i int) string
- func (a *Args) HasFlags(flags ...string) bool
- func (a *Args) HasSubcommand() bool
- func (a *Args) IndexOfParam(param string) int
- func (a *Args) InsertParam(i int, items ...string)
- func (a *Args) IsParamsEmpty() bool
- func (a *Args) LastParam() string
- func (a *Args) NoForward()
- func (a *Args) ParamsSize() int
- func (a *Args) PrependParams(params ...string)
- func (a *Args) RemoveParam(i int) string
- func (a *Args) Replace(executable, command string, params ...string)
- func (a *Args) ReplaceParam(i int, item string)
- func (a *Args) ToCmd() *cmd.Cmd
- func (a *Args) Words() []string
- type Command
- type ExecError
- type Runner
- type Updater
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NameRe = "[\\w.][\\w.-]*" OwnerRe = "[a-zA-Z0-9][a-zA-Z0-9-]*" NameWithOwnerRe = fmt.Sprintf("^(?:%s|%s\\/%s)$", NameRe, OwnerRe, NameRe) CmdRunner = NewRunner() )
View Source
var EnableAutoUpdate = false
Functions ¶
This section is empty.
Types ¶
type Args ¶
type Args struct { Executable string GlobalFlags []string Command string Params []string Noop bool Terminator bool Callbacks []func() error // contains filtered or unexported fields }
func (*Args) AppendParams ¶
func (*Args) FirstParam ¶
func (*Args) HasSubcommand ¶
func (*Args) IndexOfParam ¶
func (*Args) InsertParam ¶
func (*Args) IsParamsEmpty ¶
func (*Args) ParamsSize ¶
func (*Args) PrependParams ¶
func (*Args) RemoveParam ¶
func (*Args) ReplaceParam ¶
type Command ¶
type Command struct { Run func(cmd *Command, args *Args) Flag flag.FlagSet Key string Usage string Short string Long string GitExtension bool // contains filtered or unexported fields }
func (*Command) FormattedUsage ¶
func (*Command) PrintUsage ¶
func (c *Command) PrintUsage()
Source Files
¶
Click to show internal directories.
Click to hide internal directories.