mirror of https://github.com/chzyer/readline.git
Merge pull request #38 from buaazp/master
add SetChildren for prefix completer interface
This commit is contained in:
commit
402307d9c0
|
@ -12,6 +12,7 @@ type PrefixCompleterInterface interface {
|
|||
Do(line []rune, pos int) (newLine [][]rune, length int)
|
||||
GetName() []rune
|
||||
GetChildren() []PrefixCompleterInterface
|
||||
SetChildren(children []PrefixCompleterInterface)
|
||||
}
|
||||
|
||||
type PrefixCompleter struct {
|
||||
|
@ -53,6 +54,10 @@ func (p *PrefixCompleter) GetChildren() []PrefixCompleterInterface {
|
|||
return p.Children
|
||||
}
|
||||
|
||||
func (p *PrefixCompleter) SetChildren(children []PrefixCompleterInterface) {
|
||||
p.Children = children
|
||||
}
|
||||
|
||||
func NewPrefixCompleter(pc ...PrefixCompleterInterface) *PrefixCompleter {
|
||||
return PcItem("", pc...)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue