// rootCmd represents the base command when called without any subcommands
// rootCmd represents the base command when called without any subcommands
varrootCmd=&cobra.Command{
varrootCmd=&cobra.Command{
@ -56,7 +57,8 @@ func init() {
// Cobra supports persistent flags, which, if defined here,
// Cobra supports persistent flags, which, if defined here,
// will be global for your application.
// will be global for your application.
rootCmd.PersistentFlags().StringVar(&cfgFile,"config","","config file (default is $HOME/.pinned-package-updater.yaml OR ./.pinned-package-updater.yaml)")
rootCmd.PersistentFlags().StringVar(&configFile,"config","","config file (default is $HOME/.pinned-package-updater.yaml OR ./.pinned-package-updater.yaml)")
rootCmd.PersistentFlags().StringVar(&remoteURL,"remote","","remote url for distributed mode (example: https://ppu.example.com/)")
// Cobra also supports local flags, which will only run
// Cobra also supports local flags, which will only run
// when this action is called directly.
// when this action is called directly.
@ -65,8 +67,8 @@ func init() {
// initConfig reads in config file and ENV variables if set.
// initConfig reads in config file and ENV variables if set.
funcinitConfig(){
funcinitConfig(){
ifcfgFile!=""{
viper.SetConfigFile(cfgFile)
ifconfigFile!=""{
viper.SetConfigFile(configFile)
}else{
}else{
// Search config in home directory with name ".pinned-package-updater" (without extension).
// Search config in home directory with name ".pinned-package-updater" (without extension).