add vendor
This commit is contained in:
19
vendor/github.com/posener/complete/match/file.go
generated
vendored
Normal file
19
vendor/github.com/posener/complete/match/file.go
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
package match
|
||||
|
||||
import "strings"
|
||||
|
||||
// File returns true if prefix can match the file
|
||||
func File(file, prefix string) bool {
|
||||
// special case for current directory completion
|
||||
if file == "./" && (prefix == "." || prefix == "") {
|
||||
return true
|
||||
}
|
||||
if prefix == "." && strings.HasPrefix(file, ".") {
|
||||
return true
|
||||
}
|
||||
|
||||
file = strings.TrimPrefix(file, "./")
|
||||
prefix = strings.TrimPrefix(prefix, "./")
|
||||
|
||||
return strings.HasPrefix(file, prefix)
|
||||
}
|
6
vendor/github.com/posener/complete/match/match.go
generated
vendored
Normal file
6
vendor/github.com/posener/complete/match/match.go
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
package match
|
||||
|
||||
// Match matches two strings
|
||||
// it is used for comparing a term to the last typed
|
||||
// word, the prefix, and see if it is a possible auto complete option.
|
||||
type Match func(term, prefix string) bool
|
9
vendor/github.com/posener/complete/match/prefix.go
generated
vendored
Normal file
9
vendor/github.com/posener/complete/match/prefix.go
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
package match
|
||||
|
||||
import "strings"
|
||||
|
||||
// Prefix is a simple Matcher, if the word is it's prefix, there is a match
|
||||
// Match returns true if a has the prefix as prefix
|
||||
func Prefix(long, prefix string) bool {
|
||||
return strings.HasPrefix(long, prefix)
|
||||
}
|
Reference in New Issue
Block a user