summaryrefslogtreecommitdiff
path: root/match/match.go
diff options
context:
space:
mode:
authorEyal Posener <[email protected]>2019-11-14 06:51:44 +0200
committerEyal Posener <[email protected]>2019-11-18 01:05:47 +0200
commit8724aaf18312e54750540a9578e00d61b1c545d8 (patch)
treed3e736b4fb279975bbcc017ae1bad53e454c5773 /match/match.go
parent05b68ffc813dd10c420993cb1cf927b346c057b8 (diff)
V2
Diffstat (limited to 'match/match.go')
-rw-r--r--match/match.go39
1 files changed, 0 insertions, 39 deletions
diff --git a/match/match.go b/match/match.go
deleted file mode 100644
index b5f1814..0000000
--- a/match/match.go
+++ /dev/null
@@ -1,39 +0,0 @@
-// Package match contains matchers that decide if to apply completion.
-//
-// This package is deprecated.
-package match
-
-import "strings"
-
-// 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.
-//
-// Deprecated.
-type Match func(term, prefix string) bool
-
-// 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
-//
-// Deprecated.
-func Prefix(long, prefix string) bool {
- return strings.HasPrefix(long, prefix)
-}
-
-// File returns true if prefix can match the file
-//
-// Deprecated.
-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)
-}