command

package
v0.0.0-...-7eb9505 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2017 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitCodeOK     int = 0
	ExitCodeFailed int = 1
)

ExitCodes

View Source
const (
	// DefaultVCSHost is the default VCS host name.
	DefaultVCSHost = "github.com"

	// DefaultLocalDir is the default path to store directory.
	DefaultLocalDir = "~/.gcli.d"

	// DefaultLocalStaticDir is the default path for static file.
	DefaultLocalStaticDir = "static"
)
View Source
const CheckTimeout = 3 * time.Second

CheckTimeout is timeout of executing go-latest.Check()

View Source
const (
	// EnvGoPath is env name of GOPATH
	EnvGoPath = "GOPATH"
)

Variables

This section is empty.

Functions

func CheckLatest

func CheckLatest(version string) <-chan *latest.CheckResponse

CheckLatest run tcnksm/go-latest with gcli settings. It retuns channel of checking results. Even if something wrong happened, it neglects error because this is not important part of gcli execution.

Types

type ApplyCommand

type ApplyCommand struct {
	Meta
}

ApplyCommand is a Command that generates a new cli project

func (*ApplyCommand) Help

func (c *ApplyCommand) Help() string

Help is a long-form help text that includes the command-line usage, a brief few sentences explaining the function of the command, and the complete list of flags the command accepts.

func (*ApplyCommand) Run

func (c *ApplyCommand) Run(args []string) int

Run generates a new cli project. It returns exit code

func (*ApplyCommand) Synopsis

func (c *ApplyCommand) Synopsis() string

Synopsis is a one-line, short synopsis of the command.

type CommandFlag

type CommandFlag []*skeleton.Command

CommandFlag implements the flag.Value interface and allows multiple calls to the same variable to append a list. It parses string and set them as skeleton.Command.

func (*CommandFlag) Set

func (c *CommandFlag) Set(v string) error

Set parses input string and appends it on CommandFlags. Input format must be NAME[:SYNOPSIS] format.x

func (*CommandFlag) String

func (c *CommandFlag) String() string

String

type DesignCommand

type DesignCommand struct {
	Meta
}

DesignCommand is a Command that generates a new cli project

func (*DesignCommand) Help

func (c *DesignCommand) Help() string

Help is a long-form help text that includes the command-line usage, a brief few sentences explaining the function of the command, and the complete list of flags the command accepts.

func (*DesignCommand) Run

func (c *DesignCommand) Run(args []string) int

Run generates a new cli project. It returns exit code

func (*DesignCommand) Synopsis

func (c *DesignCommand) Synopsis() string

Synopsis is a one-line, short synopsis of the command.

type FlagFlag

type FlagFlag []*skeleton.Flag

FlagFlag implements the flag.Value interface and allows multiple calls to the same variable to append a list. It parses string and set them as skeleton.Flag.

func (*FlagFlag) Set

func (f *FlagFlag) Set(v string) error

Set parses input string and appends it on FlagdFlag. Input format must be NAME:TYPE:SYNOPSIS format.

func (*FlagFlag) String

func (f *FlagFlag) String() string

String

type ListCommand

type ListCommand struct {
	Meta
}

ListCommand is a Command that lists all avairable frameworks

func (*ListCommand) Help

func (c *ListCommand) Help() string

Help is a long-form help text that includes the command-line usage, a brief few sentences explaining the function of the command, and the complete list of flags the command accepts.

func (*ListCommand) Run

func (c *ListCommand) Run(args []string) int

Run lists all avairable frameworks.

func (*ListCommand) Synopsis

func (c *ListCommand) Synopsis() string

Synopsis is a one-line, short synopsis of the command.

type Meta

type Meta struct {
	UI cli.Ui
}

Meta contain the meta-option that nealy all subcommand inherited.

func (*Meta) LocalDir

func (m *Meta) LocalDir() (string, error)

LocalDir returns the local directory for storing user defined data.

func (*Meta) NewFlagSet

func (m *Meta) NewFlagSet(name string, helpText string) *flag.FlagSet

NewFlagSet generates commom flag.FlagSet

type NewCommand

type NewCommand struct {
	Meta
}

NewCommand is a Command that generates a new cli project

func (*NewCommand) Help

func (c *NewCommand) Help() string

Help is a long-form help text that includes the command-line usage, a brief few sentences explaining the function of the command, and the complete list of flags the command accepts.

func (*NewCommand) Run

func (c *NewCommand) Run(args []string) int

Run generates a new cli project. It returns exit code

func (*NewCommand) Synopsis

func (c *NewCommand) Synopsis() string

Synopsis is a one-line, short synopsis of the command.

type ValidateCommand

type ValidateCommand struct {
	Meta
}

ValidateCommand is a Command that validate template file

func (*ValidateCommand) Help

func (c *ValidateCommand) Help() string

Help is a long-form help text that includes the command-line usage, a brief few sentences explaining the function of the command, and the complete list of flags the command accepts.

func (*ValidateCommand) Run

func (c *ValidateCommand) Run(args []string) int

Run validates template file

func (*ValidateCommand) Synopsis

func (c *ValidateCommand) Synopsis() string

Synopsis is a one-line, short synopsis of the command.

type VersionCommand

type VersionCommand struct {
	Meta

	Version  string
	Revision string
}

VersionCommand is a Command that shows version

func (*VersionCommand) Help

func (c *VersionCommand) Help() string

Help is a long-form help text. In this case, help text is not neccessary.

func (*VersionCommand) Run

func (c *VersionCommand) Run(args []string) int

Run shows version string and commit hash if it exists. It returns exit code

func (*VersionCommand) Synopsis

func (c *VersionCommand) Synopsis() string

Synopsis is a one-line, short synopsis of the command.

Jump to

Keyboard shortcuts

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