diff options
| author | Christine Dodrill <me@christine.website> | 2019-11-28 19:24:35 +0000 |
|---|---|---|
| committer | Christine Dodrill <me@christine.website> | 2019-11-28 19:24:35 +0000 |
| commit | faa5368bc50c84c3a1dfaf67bc21c2cd2bbb921f (patch) | |
| tree | 8724fdbe33bc30504b09ccc3f4ded682de4c2f8b /cmd/license | |
| parent | a24e7b68f0b4abd992b45536b2b3b7aab52e941a (diff) | |
| download | x-faa5368bc50c84c3a1dfaf67bc21c2cd2bbb921f.tar.xz x-faa5368bc50c84c3a1dfaf67bc21c2cd2bbb921f.zip | |
completionv1.2.0
Diffstat (limited to 'cmd/license')
| -rw-r--r-- | cmd/license/main.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/license/main.go b/cmd/license/main.go index d45b30f..738cf2e 100644 --- a/cmd/license/main.go +++ b/cmd/license/main.go @@ -12,6 +12,7 @@ import ( "text/template" "time" + "github.com/posener/complete" "within.website/x/cmd/license/licenses" "within.website/x/internal" ) @@ -33,6 +34,15 @@ func init() { fmt.Fprintln(os.Stderr, "\nBy default the name and email are scraped from `git config`") os.Exit(2) } + + var names []string + for name := range licenses.List { + names = append(names, name) + } + + sort.Strings(names) + + internal.HandleCompletion(complete.PredictSet(names...), nil) } func main() { |
