From 3d7772dc6ef3c7fd61ee38837868af4f3299071c Mon Sep 17 00:00:00 2001 From: Diwaker Gupta Date: Tue, 15 Mar 2016 22:06:52 -0700 Subject: [PATCH] Silence usage on errors. Also remove redundant print of errorrs; cobra already does this. Fixes #1 --- cmd/root.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/root.go b/cmd/root.go index b2501fb..a0bea08 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -161,6 +161,7 @@ var RootCmd = &cobra.Command{ Short: "A command line tool for Dropbox users and team admins", Long: `Use dbxcli to quickly interact with your Dropbox, upload/download files, manage your team and more. It is easy, scriptable and works on all platforms!`, + SilenceUsage: true, PersistentPreRunE: initDbx, } @@ -168,7 +169,6 @@ manage your team and more. It is easy, scriptable and works on all platforms!`, // This is called by main.main(). It only needs to happen once to the rootCmd. func Execute() { if err := RootCmd.Execute(); err != nil { - fmt.Println(err) os.Exit(-1) } }