diff --git a/cmd/root.go b/cmd/root.go index 3332c5c..d73c696 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -5,8 +5,10 @@ package cmd import ( "fmt" + "log" "os" + "git.agecem.com/agecem/bottin-ag/config" "github.com/spf13/cobra" "github.com/spf13/viper" ) @@ -30,6 +32,10 @@ func init() { cobra.OnInitialize(initConfig) rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.bottin-ag.yaml)") + + if err := config.RegisterFlags(rootCmd); err != nil { + log.Fatal(err) + } } // initConfig reads in config file and ENV variables if set.