From bddf734658d5a7ffee5ca57b2432d4fee234970f Mon Sep 17 00:00:00 2001 From: Zee Date: Thu, 12 Sep 2019 18:17:38 +0100 Subject: [PATCH] More tweaks and changes to code for listing and removing --- cmd/list.go | 8 +++++++- cmd/remove.go | 8 +------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/list.go b/cmd/list.go index 42448f6..626fd5f 100644 --- a/cmd/list.go +++ b/cmd/list.go @@ -30,7 +30,12 @@ var listCmd = &cobra.Command{ Use: "list", Short: "List downloaded kubectl binaries", Run: func(cmd *cobra.Command, args []string) { - _ = ListKubectlBinaries() + fmt.Println("Retrieving installed versions of kubectl") + + err := ListKubectlBinaries() + if err != nil { + log.Fatal(err) + } }, } @@ -48,6 +53,7 @@ func init() { // listCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") } +// ListKubectlBinaries - List available installed kubectl versions func ListKubectlBinaries() error { // Get user home directory path diff --git a/cmd/remove.go b/cmd/remove.go index 2bd01d2..64bccd9 100644 --- a/cmd/remove.go +++ b/cmd/remove.go @@ -26,13 +26,7 @@ import ( // removeCmd represents the remove command var removeCmd = &cobra.Command{ Use: "remove", - Short: "A brief description of your command", - Long: `A longer description that spans multiple lines and likely contains examples -and usage of using your command. For example: - -Cobra is a CLI library for Go that empowers applications. -This application is a tool to generate the needed files -to quickly create a Cobra application.`, + Short: "Remove a kubectl version from machine", Run: func(cmd *cobra.Command, args []string) { err := RemoveKubectlVersion(args[0]) if err != nil {