diff --git a/complete_helper.go b/complete_helper.go index 2564a5c..4c10f51 100644 --- a/complete_helper.go +++ b/complete_helper.go @@ -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...) }