Use helper for logging command error
This commit is contained in:
parent
310ebb319f
commit
2000747176
10
cmd/root.go
10
cmd/root.go
@ -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() {
|
||||
|
Reference in New Issue
Block a user