diff options
| author | Eyal Posener <[email protected]> | 2017-05-06 22:06:49 +0300 |
|---|---|---|
| committer | Eyal Posener <[email protected]> | 2017-05-06 22:15:15 +0300 |
| commit | 703dd6ebc30f7c6f5a5c02e07a307e0e34d9c2c2 (patch) | |
| tree | 6efd5f6d1205eb6188193c86f5dd1e256b8996c5 /run.go | |
| parent | 9963a854946be0603f9e79ccba0a8b2688b20053 (diff) | |
improve docs
Diffstat (limited to 'run.go')
| -rw-r--r-- | run.go | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -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()) } } |
