summaryrefslogtreecommitdiff
path: root/run.go
diff options
context:
space:
mode:
Diffstat (limited to 'run.go')
-rw-r--r--run.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/run.go b/run.go
index bd9f662..90d0df4 100644
--- a/run.go
+++ b/run.go
@@ -1,9 +1,16 @@
+// Package complete provides a tool for bash writing bash completion in go.
+//
+// Writing bash completion scripts is a hard work. This package provides an easy way
+// to create bash completion scripts for any command, and also an easy way to install/uninstall
+// the completion of the command.
package complete
import (
"fmt"
"os"
"strings"
+
+ "github.com/posener/complete/cmd"
)
const (
@@ -16,7 +23,7 @@ const (
func Run(c Command) {
args, ok := getLine()
if !ok {
- runCommandLine(c.Name)
+ cmd.Run(c.Name)
return
}
Log("Completing args: %s", args)
@@ -35,7 +42,7 @@ func complete(c Command, args []string) (matching []string) {
// choose only matching options
l := last(args)
for _, option := range options {
- if option.Matches(l) {
+ if option.Match(l) {
matching = append(matching, option.String())
}
}