Skip to content
7 changes: 7 additions & 0 deletions internal/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@ func NewAstCLI(
if err != nil {
return err
}
if cmd.Flags().Changed(params.AccessKeyIDFlag) || cmd.Flags().Changed(params.AccessKeySecretFlag) {
viper.Set(params.AstAPIKey, "")
}
if cmd.Flags().Changed(params.AstAPIKeyFlag) {
viper.Set(params.AccessKeyIDConfigKey, "")
viper.Set(params.AccessKeySecretConfigKey, "")
}
// Need to check the __complete command to allow correct behavior of the autocomplete
if len(args) > 0 && cmd.Name() != params.Help && cmd.Name() != "__complete" {
_ = cmd.Help()
Expand Down
Loading