Archived
1
0

Use helper for logging command error

This commit is contained in:
Jip J. Dekker 2016-03-17 17:46:37 +01:00
parent 310ebb319f
commit 2000747176

View File

@ -15,9 +15,7 @@
package cmd
import (
"fmt"
"os"
"github.com/jjdekker/ponder/helpers"
"github.com/spf13/cobra"
)
@ -37,10 +35,8 @@ other PDF files to be part of your song book.`,
// Execute adds all child commands to the root command sets flags appropriately.
// 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)
}
err := RootCmd.Execute()
helpers.Check(err, "Command returned an error")
}
func init() {