Files
noko-shell/suggestions/suggestions.go
T

18 lines
318 B
Go

// Package suggestions
package suggestions
import "strings"
var defaultSuggestions = []string{"exit"}
func Completer(in string) []string {
if in=="" {return nil}
var matched []string
for _,cmd := range defaultSuggestions {
if strings.HasPrefix(cmd,in){
matched=append(matched, cmd)
}
}
return matched
}