Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ListUserCmd = &gcli.Command{ Name: "list", Desc: "list all added user commands", Aliases: []string{"ls", "l"}, }
View Source
var TaskInfo = &gcli.Command{
Name: "info",
Desc: "show an Task information",
}
View Source
var TaskList = &gcli.Command{ Name: "list", Desc: "list all Tasks", Aliases: []string{"ls", "l"}, }
View Source
var TaskManageCmd = &gcli.Command{ Name: "task", Desc: "Task/Script run and management command", Subs: []*gcli.Command{ TaskList, TaskInfo, TaskRun, }, Config: func(c *gcli.Command) { }, Func: func(c *gcli.Command, args []string) error { return nil }, }
TaskManageCmd instance
View Source
var TaskRun = &gcli.Command{
Name: "run",
Desc: "run an Task",
}
View Source
var UserExtCmd = &gcli.Command{ Name: "xapp", Aliases: []string{"xcmd", "uapp", "ucmd"}, Desc: "manage and execute user extension cli app commands", Subs: []*gcli.Command{ ListUserCmd, }, Config: func(c *gcli.Command) { c.BoolOpt2(&ueOpts.list, "list, ls", "display all user extra commands") c.StrOpt2(&ueOpts.info, "info, show, i", "display info for the input command") c.AddArg("command", "input command for execute") }, Func: func(c *gcli.Command, args []string) error { name := c.Arg("command").String() if len(name) == 0 { return c.NewErr("please input command name for handle") } return nil }, }
UserExtCmd instance TODO 暂时由 kscript.scriptApp 替代
Functions ¶
Types ¶
type CmdAction ¶
type CmdAction struct {
Name string `json:"name"`
Desc string `json:"desc"`
User string `json:"user"`
Workdir string `json:"workdir"`
Cmds []string `json:"cmds"`
}
CmdAction struct
type CmdGroup ¶
type CmdGroup struct {
Name string `json:"name"`
Version string `json:"version"`
Author string `json:"author"`
// Description message
Description string `json:"description"`
// DefaultAction on run
DefaultAction string `json:"default_action"`
Context struct {
Workdir string `json:"workdir"`
} `json:"context"`
Actions map[string]*CmdAction `json:"actions"`
}
CmdGroup struct
Click to show internal directories.
Click to hide internal directories.