Documentation
¶
Index ¶
- func AllHelpString(node *CommandNode) string
- func AllHelpStringInner(node *CommandNode) (ret [][]string)
- func ExecuteCommand(mgr *base.TaskActionManager, rl *readline.Instance, input string)
- func GetCurrentReadlineInstance() *readline.Instance
- func HistoryCmd(base.TaskActionImpl, []string) string
- func NewCompleter() *readline.PrefixCompleter
- func QuitCmd(base.TaskActionImpl, []string) string
- func ReadLine()
- func RegisterCommand(path []string, fn CommandFunc, argsInfo string, desc string, ...)
- func RegisterCommandDefaultTimeout(path []string, fn CommandFunc, argsInfo string, desc string, ...)
- func StdoutLog(log string)
- type CommandFunc
- type CommandNode
- type HistoryManager
- type TaskActionCmd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllHelpString ¶
func AllHelpString(node *CommandNode) string
func AllHelpStringInner ¶
func AllHelpStringInner(node *CommandNode) (ret [][]string)
func ExecuteCommand ¶
func ExecuteCommand(mgr *base.TaskActionManager, rl *readline.Instance, input string)
ExecuteCommand 执行命令
func HistoryCmd ¶
func HistoryCmd(base.TaskActionImpl, []string) string
func RegisterCommand ¶
func RegisterCommand(path []string, fn CommandFunc, argsInfo string, desc string, dynamicComplete readline.DynamicCompleteFunc, timeout time.Duration)
func RegisterCommandDefaultTimeout ¶
func RegisterCommandDefaultTimeout(path []string, fn CommandFunc, argsInfo string, desc string, dynamicComplete readline.DynamicCompleteFunc)
Types ¶
type CommandFunc ¶
type CommandFunc func(base.TaskActionImpl, []string) string
type CommandNode ¶
type CommandNode struct {
Children map[string]*CommandNode
Name string
FullName string
Func CommandFunc
ArgsInfo string
Desc string
DynamicComplete readline.DynamicCompleteFunc
Timeout time.Duration
}
func FindCommand ¶
func FindCommand(path string) (args []string, node *CommandNode)
FindCommand 根据路径查找命令节点
func MutableCommandRoot ¶
func MutableCommandRoot() *CommandNode
func (*CommandNode) SelfHelpString ¶
func (node *CommandNode) SelfHelpString() []string
type HistoryManager ¶
type HistoryManager struct {
File string
Items []string
Set map[string]struct{}
// contains filtered or unexported fields
}
func NewHistoryManager ¶
func NewHistoryManager(file string, cleanDuplicates bool) *HistoryManager
type TaskActionCmd ¶
type TaskActionCmd struct {
base.TaskActionBase
Fn func()
}
func (*TaskActionCmd) HookRun ¶
func (t *TaskActionCmd) HookRun() error
func (*TaskActionCmd) Log ¶
func (t *TaskActionCmd) Log(format string, a ...any)
Click to show internal directories.
Click to hide internal directories.