Skip to content

Commit

Permalink
Merge pull request #309 from equinix/env-flag-binding
Browse files Browse the repository at this point in the history
fix: always bind flags to env vars when configuring a command
  • Loading branch information
displague authored Jul 20, 2023
2 parents 198710b + 4e1f20c commit 86ff3ab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,10 @@ func (c *Client) Config(cmd *cobra.Command) *viper.Viper {

v.SetEnvPrefix(envPrefix)
c.viper = v
bindFlags(cmd, v)
}

bindFlags(cmd, c.viper)

flagToken := cmd.Flag("token").Value.String()
envToken := cmd.Flag("auth-token").Value.String()
// TODO: are we ok with this being configured by file too? yes?
Expand Down

0 comments on commit 86ff3ab

Please sign in to comment.