Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ParseCommandLine ¶
解析命令行参数 from: https://github.com/mgutz/str.git
Types ¶
type Command ¶
type Command interface { Name() string Full() string Group() string Meta() map[string]string Subs() []Command Add(sub Command) CanRun() bool Run(ctx Context) error }
Command 以树形结构组织,只有叶节点可以可以执行
type Engine ¶
type Engine interface { List() []Command Tree() []Command Add(action Action, opts ...Option) error Exec(args []string, metas Map) (interface{}, error) }
Engine 用于管理所有Command信息 List只返回所有可执行的Command Tree会以树状的形式组织Command,只有叶节点可以执行
Click to show internal directories.
Click to hide internal directories.