summaryrefslogtreecommitdiff
path: root/cmd/install/install.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/install/install.go')
-rw-r--r--cmd/install/install.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/cmd/install/install.go b/cmd/install/install.go
index a9a01d4..884c23f 100644
--- a/cmd/install/install.go
+++ b/cmd/install/install.go
@@ -38,6 +38,24 @@ func Install(cmd string) error {
return err
}
+// IsInstalled returns true if the completion
+// for the given cmd is installed.
+func IsInstalled(cmd string) bool {
+ bin, err := getBinaryPath()
+ if err != nil {
+ return false
+ }
+
+ for _, i := range installers() {
+ installed := i.IsInstalled(cmd, bin)
+ if installed {
+ return true
+ }
+ }
+
+ return false
+}
+
// Uninstall complete command given:
// cmd: is the command name
func Uninstall(cmd string) error {