()
| 40 | } |
| 41 | |
| 42 | func init() { |
| 43 | cobra.OnInitialize(initConfig) |
| 44 | |
| 45 | // Here you will define your flags and configuration settings. |
| 46 | // Cobra supports persistent flags, which, if defined here, |
| 47 | // will be global for your application. |
| 48 | |
| 49 | rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.encoder-run/config.yaml)") |
| 50 | |
| 51 | // Cobra also supports local flags, which will only run |
| 52 | // when this action is called directly. |
| 53 | rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") |
| 54 | } |
| 55 | |
| 56 | // initConfig reads in config file and ENV variables if set. |
| 57 | func initConfig() { |
nothing calls this directly
no outgoing calls
no test coverage detected