diff --git a/cmd/asdf/main.go b/cmd/asdf/main.go index 85c958e5..997b062f 100644 --- a/cmd/asdf/main.go +++ b/cmd/asdf/main.go @@ -1,7 +1,7 @@ // Main entrypoint for the CLI app package main -import "github.com/asdf-vm/asdf/cli" +import "github.com/asdf-vm/asdf/internal/cli" // Replaced with the real version during a typical build var version = "v-dev" diff --git a/internal/cli/cli.go b/internal/cli/cli.go index cd8398f5..69d9386d 100644 --- a/internal/cli/cli.go +++ b/internal/cli/cli.go @@ -2,7 +2,6 @@ package cli import ( - _ "embed" "errors" "fmt" "io" diff --git a/internal/completions/completions.go b/internal/completions/completions.go index 7084073d..37338550 100644 --- a/internal/completions/completions.go +++ b/internal/completions/completions.go @@ -16,6 +16,8 @@ import ( //go:embed asdf.* var completions embed.FS +// Get returns a file containing completion code for the given shell if it is +// found. func Get(name string) (fs.File, bool) { file, err := completions.Open("asdf." + name) if err != nil { @@ -27,6 +29,7 @@ func Get(name string) (fs.File, bool) { return file, true } +// Names returns a slice of shell names that completion is available for. func Names() []string { files, _ := fs.Glob(completions, "asdf.*") for i, file := range files {