summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-28 05:29:55 -0500
committerJeff Carr <[email protected]>2025-10-28 05:29:55 -0500
commit0e83fccb13f0c7d84fe6db01565d5c6a876d7320 (patch)
tree2c3a42cdf681b0c80a031b724e394fe0f00ad8aa
parentd0b5b0842064a38a05a8023734bd7105bb2ab90f (diff)
implement simple match() func
-rw-r--r--complete.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/complete.go b/complete.go
index 1bd4366..a1968bf 100644
--- a/complete.go
+++ b/complete.go
@@ -80,6 +80,27 @@ func (args) Examples() string {
return out
}
+func (args) Match() bool {
+ if argvpb.PB.IsMatch("cache") {
+ matches, _ := matchCacheFiles()
+ fmt.Fprintf(argvpb.Stdout, "%s", matches)
+ return true
+ }
+
+ if argvpb.PB.IsMatch("mode.--config") {
+ matches, _ := matchModeDirs()
+ fmt.Fprintf(argvpb.Stdout, "%s", matches)
+ return true
+ }
+
+ if argvpb.PB.IsMatch("mode") {
+ matches := []string{"jwc", "false"}
+ fmt.Fprintf(argvpb.Stdout, "%s", " "+strings.Join(matches, " "))
+ return true
+ }
+ return false
+}
+
// sends the strings to bash or zsh that will be your options
func (a args) DoAutoComplete() error {
var err error