diff options
| author | Jeff Carr <[email protected]> | 2025-10-28 05:29:55 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-28 05:29:55 -0500 |
| commit | 0e83fccb13f0c7d84fe6db01565d5c6a876d7320 (patch) | |
| tree | 2c3a42cdf681b0c80a031b724e394fe0f00ad8aa | |
| parent | d0b5b0842064a38a05a8023734bd7105bb2ab90f (diff) | |
implement simple match() func
| -rw-r--r-- | complete.go | 21 |
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 |
