Skip to content

Commit

Permalink
🐛 change viper binding from api-proxy to api_proxy (#478)
Browse files Browse the repository at this point in the history
this way, when the 'login' subcommand goes to save the config file, the
--api-proxy that was set via CLI param just goes along for the ride and
ends up in the config file.

presently it ends up in the config file as 'api-proxy' which wouldn't be
picked up when reading the config file.

Signed-off-by: Joel Diaz <[email protected]>
  • Loading branch information
Joel Diaz authored Mar 29, 2023
1 parent 05bc4cf commit c5fe137
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/cnspec/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func init() {
rootCmd.PersistentFlags().String("api-proxy", "", "Set proxy for communications with Mondoo API")
viper.BindPFlag("verbose", rootCmd.PersistentFlags().Lookup("verbose"))
viper.BindPFlag("log-level", rootCmd.PersistentFlags().Lookup("log-level"))
viper.BindPFlag("api-proxy", rootCmd.PersistentFlags().Lookup("api-proxy"))
viper.BindPFlag("api_proxy", rootCmd.PersistentFlags().Lookup("api-proxy"))
viper.BindEnv("features")

config.Init(rootCmd)
Expand Down

0 comments on commit c5fe137

Please sign in to comment.