Documentation
¶
Index ¶
- Variables
- func Atexit(f func())
- func CommandList() (cmds []string)
- func Errorf(format string, args ...interface{})
- func Exit()
- func ExitIfErrors()
- func Fatalf(format string, args ...interface{})
- func Main()
- func Register(cmd *Command)
- func RunArgs(arguments []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error
- func SetExitStatus(n int)
- type Command
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Stdout io.Writer = os.Stdout Stderr io.Writer = os.Stderr Stdin io.Reader = os.Stdin )
View Source
var AppInfo string = "LiteIDE golang tool."
View Source
var AppName string = "tools"
View Source
var AppVersion string = "1.0"
Functions ¶
func CommandList ¶
func CommandList() (cmds []string)
func ExitIfErrors ¶
func ExitIfErrors()
func SetExitStatus ¶
func SetExitStatus(n int)
Types ¶
type Command ¶
type Command struct {
// Run runs the command.
// The args are the arguments after the command name.
Run func(cmd *Command, args []string) error
// UsageLine is the one-line usage message.
// The first word in the line is taken to be the command name.
UsageLine string
// Short is the short description shown in the 'go help' output.
Short string
// Long is the long message shown in the 'go help <this-command>' output.
Long string
// Flag is a set of flags specific to this command.
Flag flag.FlagSet
// CustomFlags indicates that the command will do its own
// flag parsing.
CustomFlags bool
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
}
A Command is an implementation of a go command like go build or go fix.
func (*Command) PrintUsage ¶
func (c *Command) PrintUsage()
Click to show internal directories.
Click to hide internal directories.