added shell tab complete

This commit is contained in:
Aidan 2020-07-18 10:44:34 -07:00
parent 44beab651c
commit d5edb2bad2
No known key found for this signature in database
GPG key ID: 327711E983899316
4 changed files with 125 additions and 4 deletions

View file

@ -75,3 +75,18 @@ func GetFunction(arg string, table FuncTable) *Function {
return target
}
/* lists all functions in table
*/
func ListFuncs(ft FuncTable) []string {
keys := make([]string, len(*ft))
i := 0
for k := range *ft {
keys[i] = k
i++
}
return keys
}