Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallbackCompleter ¶
type CallbackCompleter struct { Completer // contains filtered or unexported fields }
func NewCallbackCompleter ¶
func NewCallbackCompleter(m ...Matcher) *CallbackCompleter
type Combine ¶
Combine aggregates the matches of it's children. If any of the Matchers match, Accept will return all the Next. Use this when you have multiple choices that all result in the same continuation, e.g.:
/-- create --\ command ---- update ---- <id> \-- delete --/
The "create", "update" and "delete" are the Matchers of the Combine, "<id>" is the Next.
type Completer ¶
type Completer struct {
// contains filtered or unexported fields
}
A Completer provides line completion functionality based on Matchers.
func NewCompleter ¶
NewCompleter returns a new Completer based on the aggregation of the given Matchers.
type Matcher ¶
type Matcher interface { Match(word string) []Word Accept(word string) (bool, []Matcher) AddNext(m Matcher) Help(*terminal.EscapeCodes) []string }
A Matcher provides word completion functionality.
type WordCompleter ¶
type WordCompleter struct {
Completer
}
A WordCompleter provides line completion functionality based on Matchers.
func NewWordCompleter ¶
func NewWordCompleter(m ...Matcher) WordCompleter
NewWordCompleter returns a new Completer based on the aggregation of the given Matchers.