Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
()
| 49 | // Execute adds all child commands to the root command and sets flags appropriately. |
| 50 | // This is called by main.main(). It only needs to happen once to the rootCmd. |
| 51 | func Execute() { |
| 52 | if err := rootCmd.Execute(); err != nil { |
| 53 | fmt.Println(err) |
| 54 | os.Exit(1) |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | func init() { |
| 59 | cobra.OnInitialize(initConfig) |