move auth flags to set-team command
@@ -21,21 +21,20 @@ func main() {
parser := flags.NewParser(&commands.Fly, flags.HelpFlag|flags.PassDoubleDash)
parser.NamespaceDelimiter = "-"
- setTeamCommand := parser.Find("set-team")
- authConfigs := make(provider.AuthConfigs)
-
- for name, p := range provider.GetProviders() {
- authGroup := p.AuthGroup()
+ groups := parser.Find("set-team").Groups()
+ var authGroup *flags.Group
- group, err := setTeamCommand.Group.AddGroup(authGroup.Name(), "", authGroup.AuthConfig())
- if err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(1)
+ for _, group := range groups {
+ if group.ShortDescription == "Authentication" {
+ authGroup = group
+ break
+ }
}
- group.Namespace = authGroup.Namespace()
+ authConfigs := make(provider.AuthConfigs)
- authConfigs[name] = authGroup.AuthConfig()
+ for name, p := range provider.GetProviders() {
+ authConfigs[name] = p.AddAuthGroup(authGroup)
}
commands.Fly.SetTeam.ProviderAuth = authConfigs
