commands

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2013 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "1.0.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,
	cmdApply,
	cmdCherryPick,
}
View Source
var GitHub = []*Command{
	cmdPullRequest,
	cmdFork,
	cmdCreate,
	cmdCiStatus,
	cmdBrowse,
	cmdCompare,
	cmdRelease,
	cmdIssue,
}
View Source
var Remote = []*Command{
	cmdClone,
	cmdFetch,
	cmdPush,
	cmdRemote,
	cmdSubmodule,
}

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) InsertParam added in v0.15.0

func (a *Args) InsertParam(i int, items ...string)

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) PrependParams added in v0.19.2

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

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

func (*Args) Words added in v0.26.0

func (a *Args) Words() []string

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) FormattedUsage added in v0.26.0

func (c *Command) FormattedUsage() string

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 ExecError added in v0.23.0

type ExecError struct {
	Err      error
	ExitCode int
}

func (*ExecError) Error added in v0.23.0

func (execError *ExecError) Error() string

type Runner

type Runner struct {
	Args []string
}

func (*Runner) Execute

func (r *Runner) Execute() ExecError

type Updater added in v1.0.0

type Updater struct {
	Host           string
	CurrentVersion string
}

func NewUpdater added in v1.0.0

func NewUpdater() *Updater

func (*Updater) PromptForUpdate added in v1.0.0

func (updater *Updater) PromptForUpdate() (err error)

func (*Updater) Update added in v1.0.0

func (updater *Updater) Update() (err error)

Jump to

Keyboard shortcuts

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