Documentation
¶
Index ¶
- Variables
- func Completer(in prompt.Document) []prompt.Suggest
- func Executor(commandLine string)
- func MergeSuggests(destSuggests *[]prompt.Suggest, srcSuggests []prompt.Suggest)
- func Register(v *View, parent *View) (err error)
- func RegisterCommandParser(name string, commandParser *parser.CommandParser, f ParseFunc) (err error)
- func RegisterGetContextListFunc(name string, getList GetViewContextListFunc) error
- func RegisterShowViewCallback(name string, callback ShowViewFunc) error
- func SetCurrentView(name string, text string, data interface{}) (err error)
- func SetPrompt(p *prompt.Prompt)
- type Context
- type GetViewContextListFunc
- type ParseFunc
- type ShowViewFunc
- type View
- func (v *View) ExecCommnadLine(command string) (err error)
- func (v *View) Exit()
- func (v *View) GetSuggests(input string) (suggests []prompt.Suggest)
- func (v *View) MatchElem(iterator *commands.CommandIterator, elem *commands.CommandWordDefElem) (match bool, defs []commands.CommandWordDef)
- func (v *View) MatchGroup(iterator *commands.CommandIterator, group *commands.CommandWordGroup) (match bool, defs []commands.CommandWordDef)
- func (v *View) MatchNormalGroup(iterator *commands.CommandIterator, group *commands.CommandWordGroup) (match bool, defs []commands.CommandWordDef)
- func (v *View) MatchWildGroup(iterator *commands.CommandIterator, group *commands.CommandWordGroup) (match bool, defs []commands.CommandWordDef)
- func (v *View) RegisterCommandParser(commandParser *parser.CommandParser, f ParseFunc) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var EndPrompt prompt.Suggest = prompt.Suggest{ Text: "<cr>", Description: "", DisableComplete: true, }
EndPrompt end prompt
Functions ¶
func MergeSuggests ¶
MergeSuggests merge suggests
func RegisterCommandParser ¶
func RegisterCommandParser(name string, commandParser *parser.CommandParser, f ParseFunc) (err error)
RegisterCommandParser register commands to view
func RegisterGetContextListFunc ¶
func RegisterGetContextListFunc(name string, getList GetViewContextListFunc) error
func RegisterShowViewCallback ¶
func RegisterShowViewCallback(name string, callback ShowViewFunc) error
func SetCurrentView ¶
SetCurrentView set view
Types ¶
type GetViewContextListFunc ¶
type ParseFunc ¶
type ParseFunc func(ctx Context, cmddefs []commands.CommandWordDef) error
ParseFunc parse func
type View ¶
type View struct {
Name string
DefaultViewText string
CommandLists []commands.CommandList
ParserProcs []ParseFunc
Ctx Context
Parent *View
Children []*View
GetContextList GetViewContextListFunc
ShowViewCallbacks []ShowViewFunc
}
View 系统视图
func (*View) ExecCommnadLine ¶
ExecCommnadLine 执行命令
func (*View) GetSuggests ¶
GetSuggests 获取当前视图的 suggest
func (*View) MatchElem ¶
func (v *View) MatchElem(iterator *commands.CommandIterator, elem *commands.CommandWordDefElem) (match bool, defs []commands.CommandWordDef)
MatchElem match elem
func (*View) MatchGroup ¶
func (v *View) MatchGroup(iterator *commands.CommandIterator, group *commands.CommandWordGroup) (match bool, defs []commands.CommandWordDef)
MatchGroup match group
func (*View) MatchNormalGroup ¶
func (v *View) MatchNormalGroup(iterator *commands.CommandIterator, group *commands.CommandWordGroup) (match bool, defs []commands.CommandWordDef)
MatchNormalGroup match
func (*View) MatchWildGroup ¶
func (v *View) MatchWildGroup(iterator *commands.CommandIterator, group *commands.CommandWordGroup) (match bool, defs []commands.CommandWordDef)
MatchWildGroup match
func (*View) RegisterCommandParser ¶
func (v *View) RegisterCommandParser(commandParser *parser.CommandParser, f ParseFunc) (err error)
RegisterCommandParser 视图下的注册
Click to show internal directories.
Click to hide internal directories.