Files
noko-shell/suggestions/suggestions.go
T

20 lines
330 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
}