Started project, created minimal shell
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// Package suggestions
|
||||
package suggestions
|
||||
|
||||
import "github.com/c-bata/go-prompt"
|
||||
|
||||
var defaultSuggestions = []prompt.Suggest{
|
||||
{Text: "exit", Description: "Exit from shell"},
|
||||
}
|
||||
|
||||
func Completer(d prompt.Document) []prompt.Suggest {
|
||||
// Если пользователь уже начал что-то писать, фильтруем список
|
||||
return prompt.FilterHasPrefix(defaultSuggestions, d.GetWordBeforeCursor(), true)
|
||||
}
|
||||
Reference in New Issue
Block a user