Appeler config.RegisterFlags dans rootCmd
This commit is contained in:
parent
ac20221ca3
commit
2bdb22d956
1 changed files with 6 additions and 0 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue