mirror of
https://github.com/spf13/cobra
synced 2025-05-06 13:27:26 +00:00
fix undefined cfgFile in documentation
This commit is contained in:
parent
1c9c46d5c1
commit
ccc8b0da4e
1 changed files with 2 additions and 0 deletions
|
@ -218,6 +218,8 @@ import (
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var cfgFile string
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cobra.OnInitialize(initConfig)
|
cobra.OnInitialize(initConfig)
|
||||||
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.cobra.yaml)")
|
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.cobra.yaml)")
|
||||||
|
|
Loading…
Add table
Reference in a new issue