commands

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2013 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "0.13.0"

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)
)
View Source
var Basic = []*Command{
	cmdInit,
}
View Source
var Branching = []*Command{
	cmdCheckout,
	cmdMerge,
}
View Source
var GitHub = []*Command{
	cmdPullRequest,
	cmdFork,
	cmdCiStatus,
	cmdBrowse,
	cmdCompare,
}
View Source
var Remote = []*Command{
	cmdClone,
	cmdRemote,
}

Functions

This section is empty.

Types

type Args

type Args struct {
	Executable string
	Command    string
	Params     []string

	Noop bool
	// contains filtered or unexported fields
}

func NewArgs

func NewArgs(args []string) *Args

func (*Args) After

func (a *Args) After(command ...string)

func (*Args) AppendParams

func (a *Args) AppendParams(params ...string)

func (*Args) Before

func (a *Args) Before(command ...string)

func (*Args) Commands

func (a *Args) Commands() []*cmd.Cmd

func (*Args) FirstParam

func (a *Args) FirstParam() string

func (*Args) GetParam

func (a *Args) GetParam(i int) string

func (*Args) IndexOfParam

func (a *Args) IndexOfParam(param string) int

func (*Args) IsParamsEmpty

func (a *Args) IsParamsEmpty() bool

func (*Args) LastParam

func (a *Args) LastParam() string

func (*Args) ParamsSize

func (a *Args) ParamsSize() int

func (*Args) RemoveParam

func (a *Args) RemoveParam(i int) string

func (*Args) Replace added in v0.13.0

func (a *Args) Replace(executable, command string, params ...string)

func (*Args) ReplaceParam

func (a *Args) ReplaceParam(i int, item string)

func (*Args) ToCmd

func (a *Args) ToCmd() *cmd.Cmd

type Command

type Command struct {
	Run  func(cmd *Command, args *Args)
	Flag flag.FlagSet

	Usage        string
	Short        string
	Long         string
	GitExtension bool
}

func All

func All() []*Command

func (*Command) List

func (c *Command) List() bool

func (*Command) Name

func (c *Command) Name() string

func (*Command) PrintUsage

func (c *Command) PrintUsage()

func (*Command) Runnable

func (c *Command) Runnable() bool

type Runner

type Runner struct {
	Args []string
}

func (*Runner) Execute

func (r *Runner) Execute() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL