Add json tables output to debug mode

This commit is contained in:
Patrick O'brien 2016-09-04 20:27:19 +10:00
parent 513e490c00
commit e35ecd76c1
3 changed files with 15 additions and 1 deletions

View file

@ -78,7 +78,7 @@ func main() {
if e, ok := err.(commandFailure); ok {
fmt.Printf("Error: %v\n\n", string(e))
rootCmd.Help()
} else if !viper.GetBool("debug") {
} else if !cmdConfig.Debug {
fmt.Printf("Error: %v\n", err)
} else {
fmt.Printf("Error: %+v\n", err)
@ -107,6 +107,7 @@ func preRun(cmd *cobra.Command, args []string) error {
DriverName: driverName,
OutFolder: viper.GetString("output"),
PkgName: viper.GetString("pkgname"),
Debug: viper.GetBool("debug"),
NoTests: viper.GetBool("no-tests"),
NoHooks: viper.GetBool("no-hooks"),
NoAutoTimestamps: viper.GetBool("no-auto-timestamps"),