mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
Fixed root persistent flags not binding correctly
This commit is contained in:
parent
809aa91ec6
commit
7285492815
3 changed files with 12 additions and 9 deletions
13
cmd/root.go
13
cmd/root.go
|
|
@ -83,13 +83,12 @@ func init() {
|
|||
rootCmd.PersistentFlags().StringVar(&cachePath, "cache", fmt.Sprintf("/tmp/%s/magellan/assets.db", currentUser.Username), "set the scanning result cache path")
|
||||
|
||||
// bind viper config flags with cobra
|
||||
checkBindFlagError(viper.BindPFlag("concurrency", rootCmd.Flags().Lookup("concurrency")))
|
||||
checkBindFlagError(viper.BindPFlag("timeout", rootCmd.Flags().Lookup("timeout")))
|
||||
checkBindFlagError(viper.BindPFlag("verbose", rootCmd.Flags().Lookup("verbose")))
|
||||
checkBindFlagError(viper.BindPFlag("debug", rootCmd.Flags().Lookup("debug")))
|
||||
checkBindFlagError(viper.BindPFlag("access-token", rootCmd.Flags().Lookup("verbose")))
|
||||
checkBindFlagError(viper.BindPFlag("cache", rootCmd.Flags().Lookup("cache")))
|
||||
checkBindFlagError(viper.BindPFlags(rootCmd.Flags()))
|
||||
checkBindFlagError(viper.BindPFlag("concurrency", rootCmd.PersistentFlags().Lookup("concurrency")))
|
||||
checkBindFlagError(viper.BindPFlag("timeout", rootCmd.PersistentFlags().Lookup("timeout")))
|
||||
checkBindFlagError(viper.BindPFlag("verbose", rootCmd.PersistentFlags().Lookup("verbose")))
|
||||
checkBindFlagError(viper.BindPFlag("debug", rootCmd.PersistentFlags().Lookup("debug")))
|
||||
checkBindFlagError(viper.BindPFlag("access-token", rootCmd.PersistentFlags().Lookup("verbose")))
|
||||
checkBindFlagError(viper.BindPFlag("cache", rootCmd.PersistentFlags().Lookup("cache")))
|
||||
}
|
||||
|
||||
func checkBindFlagError(err error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue