diff --git a/nsd/cmd/root.go b/nsd/cmd/root.go index 6d0cca5..622d312 100644 --- a/nsd/cmd/root.go +++ b/nsd/cmd/root.go @@ -1,16 +1,24 @@ package cmd import ( + "os" + "github.com/spf13/cobra" ) var rootCmd = &cobra.Command{ - Use: "nsd", - Short: "A simple cli downloader for nodejs, npm and yarn", - Long: "", + Use: "nsd", + Short: "A simple cli downloader for nodejs, npm and yarn", + Long: "", + SilenceUsage: true, } // Execute executes the root command. func Execute() error { - return rootCmd.Execute() + if err := rootCmd.Execute(); err != nil { + os.Exit(1) + return err + } + + return nil }