(guid string, username string)
| 52 | } |
| 53 | |
| 54 | func (p *SpaceUsersUIPrinter) PrintUsers(guid string, username string) { |
| 55 | for _, role := range p.Roles { |
| 56 | displayName := p.RoleDisplayNames[role] |
| 57 | users, err := p.UserLister(guid, role) |
| 58 | if err != nil { |
| 59 | p.UI.Failed(T("Failed fetching space-users for role {{.SpaceRoleToDisplayName}}.\n{{.Error}}", |
| 60 | map[string]interface{}{ |
| 61 | "Error": err.Error(), |
| 62 | "SpaceRoleToDisplayName": displayName, |
| 63 | })) |
| 64 | return |
| 65 | } |
| 66 | p.UI.Say("") |
| 67 | p.UI.Say("%s", terminal.HeaderColor(displayName)) |
| 68 | |
| 69 | if len(users) == 0 { |
| 70 | p.UI.Say(" " + T("No {{.Role}} found", map[string]interface{}{ |
| 71 | "Role": displayName, |
| 72 | })) |
| 73 | } else { |
| 74 | for _, user := range users { |
| 75 | if len(user.Username) > 0 { |
| 76 | p.UI.Say(" %s", user.Username) |
| 77 | } else { |
| 78 | p.UI.Say(" %s (client)", user.GUID) |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | } |
| 83 | } |
nothing calls this directly
no test coverage detected