Skip to content

Commit

Permalink
fix: CLI --json flag now works
Browse files Browse the repository at this point in the history
  • Loading branch information
randomshinichi committed May 27, 2019
1 parent 3f239a1 commit 911392d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var RootCmd = &cobra.Command{
// Run: func(cmd *cobra.Command, args []string) { },
}

var debug, outputFormatJSON bool
var debug bool

// 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.
Expand Down Expand Up @@ -66,5 +66,5 @@ func init() {
RootCmd.PersistentFlags().StringVarP(&aeternity.Config.Node.URL, "external-api", "u", viper.GetString("EXTERNAL_API"), "node external API endpoint")
RootCmd.PersistentFlags().StringVarP(&aeternity.Config.Node.NetworkID, "network-id", "n", viper.GetString("NETWORK_ID"), "network ID for custom private net")
RootCmd.PersistentFlags().BoolVar(&debug, "debug", false, "enable debug")
RootCmd.PersistentFlags().BoolVar(&outputFormatJSON, "json", false, "print output in json format")
RootCmd.PersistentFlags().BoolVar(&aeternity.Config.Tuning.OutputFormatJSON, "json", false, "print output in json format")
}

0 comments on commit 911392d

Please sign in to comment.