command

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2015 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

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

ExitCodes

View Source
const CheckTimeout = 3 * time.Second

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

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 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 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.

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 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