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.
()
| 33 | // Execute adds all child commands to the root command and sets flags appropriately. |
| 34 | // This is called by main.main(). It only needs to happen once to the rootCmd. |
| 35 | func Execute() { |
| 36 | err := rootCmd.Execute() |
| 37 | if err != nil { |
| 38 | os.Exit(1) |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | func init() { |
| 43 | cobra.OnInitialize(initConfig) |