Documentation ¶
Index ¶
- func AllCommands() map[string]CommandInterface
- func ParseArgs(s string) (args []string)
- func Register(cmdPtr interface{})
- func Run(code string) error
- func Try(args []string) bool
- type Command
- func (this *Command) Arg(index int) (value string, found bool)
- func (this *Command) Error(err error)
- func (this *Command) ErrorString(err string)
- func (this *Command) HasParam(key string) bool
- func (this *Command) Output(message ...interface{})
- func (this *Command) Param(key string) (value string, found bool)
- func (this *Command) Printf(format string, args ...interface{})
- func (this *Command) Println(message ...interface{})
- func (this *Command) SubCode() string
- type CommandInterface
- type HelpCommand
- type QuitCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllCommands ¶
func AllCommands() map[string]CommandInterface
Types ¶
type CommandInterface ¶
type HelpCommand ¶
type HelpCommand struct {
*Command
}
命令帮助
func (*HelpCommand) Codes ¶
func (this *HelpCommand) Codes() []string
func (*HelpCommand) Name ¶
func (this *HelpCommand) Name() string
func (*HelpCommand) Run ¶
func (this *HelpCommand) Run()
func (*HelpCommand) Usage ¶
func (this *HelpCommand) Usage() string
type QuitCommand ¶
type QuitCommand struct {
*Command
}
退出命令
func (*QuitCommand) Codes ¶
func (this *QuitCommand) Codes() []string
func (*QuitCommand) Name ¶
func (this *QuitCommand) Name() string
func (*QuitCommand) Run ¶
func (this *QuitCommand) Run()
func (*QuitCommand) Usage ¶
func (this *QuitCommand) Usage() string
Click to show internal directories.
Click to hide internal directories.