mirror of
https://github.com/spf13/cobra
synced 2025-05-06 05:17:21 +00:00
Merge aebea8a8b3
into a1f051bc3e
This commit is contained in:
commit
7e77f9557d
1 changed files with 1 additions and 1 deletions
|
@ -45,7 +45,7 @@ func init() {
|
||||||
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.cobra.yaml)")
|
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.cobra.yaml)")
|
||||||
rootCmd.PersistentFlags().StringP("author", "a", "YOUR NAME", "author name for copyright attribution")
|
rootCmd.PersistentFlags().StringP("author", "a", "YOUR NAME", "author name for copyright attribution")
|
||||||
rootCmd.PersistentFlags().StringVarP(&userLicense, "license", "l", "", "name of license for the project")
|
rootCmd.PersistentFlags().StringVarP(&userLicense, "license", "l", "", "name of license for the project")
|
||||||
rootCmd.PersistentFlags().Bool("viper", true, "use Viper for configuration")
|
rootCmd.PersistentFlags().Bool("viper", false, "use Viper for configuration")
|
||||||
viper.BindPFlag("author", rootCmd.PersistentFlags().Lookup("author"))
|
viper.BindPFlag("author", rootCmd.PersistentFlags().Lookup("author"))
|
||||||
viper.BindPFlag("useViper", rootCmd.PersistentFlags().Lookup("viper"))
|
viper.BindPFlag("useViper", rootCmd.PersistentFlags().Lookup("viper"))
|
||||||
viper.SetDefault("author", "NAME HERE <EMAIL ADDRESS>")
|
viper.SetDefault("author", "NAME HERE <EMAIL ADDRESS>")
|
||||||
|
|
Loading…
Add table
Reference in a new issue