cmd/root.go
changeset 125 d436b88d137b
parent 91 02312ccc1fd3
child 135 55b4a119c7c6
equal deleted inserted replaced
124:20d514540f37 125:d436b88d137b
   167 	RootCmd.PersistentFlags().Lookup("theme").Annotations = annotationTheme
   167 	RootCmd.PersistentFlags().Lookup("theme").Annotations = annotationTheme
   168 }
   168 }
   169 
   169 
   170 // initConfig reads in config file and ENV variables if set.
   170 // initConfig reads in config file and ENV variables if set.
   171 func initConfig() {
   171 func initConfig() {
       
   172 	if cfgFile == "/dev/null" {
       
   173 		return
       
   174 	}
   172 	if cfgFile != "" { // enable ability to specify config file via flag
   175 	if cfgFile != "" { // enable ability to specify config file via flag
   173 		viper.SetConfigFile(cfgFile)
   176 		viper.SetConfigFile(cfgFile)
   174 	}
   177 	}
   175 
   178 
   176 	viper.SetConfigName(AppName) // name of config file (without extension)
   179 	viper.SetConfigName(AppName) // name of config file (without extension)