MCPcopy Index your code
hub / github.com/cloudfoundry/cli / PrintUsers

Method PrintUsers

cf/actors/userprint/ui.go:23–52  ·  view source on GitHub ↗
(guid string, username string)

Source from the content-addressed store, hash-verified

21}
22
23func (p *OrgUsersUIPrinter) PrintUsers(guid string, username string) {
24 for _, role := range p.Roles {
25 displayName := p.RoleDisplayNames[role]
26 users, err := p.UserLister(guid, role)
27 if err != nil {
28 p.UI.Failed(T("Failed fetching org-users for role {{.OrgRoleToDisplayName}}.\n{{.Error}}",
29 map[string]interface{}{
30 "Error": err.Error(),
31 "OrgRoleToDisplayName": displayName,
32 }))
33 return
34 }
35 p.UI.Say("")
36 p.UI.Say("%s", terminal.HeaderColor(displayName))
37
38 if len(users) == 0 {
39 p.UI.Say(" " + T("No {{.Role}} found", map[string]interface{}{
40 "Role": displayName,
41 }))
42 } else {
43 for _, user := range users {
44 if len(user.Username) > 0 {
45 p.UI.Say(" %s", user.Username)
46 } else {
47 p.UI.Say(" %s (client)", user.GUID)
48 }
49 }
50 }
51 }
52}
53
54func (p *SpaceUsersUIPrinter) PrintUsers(guid string, username string) {
55 for _, role := range p.Roles {

Callers

nothing calls this directly

Calls 4

HeaderColorFunction · 0.92
FailedMethod · 0.65
ErrorMethod · 0.65
SayMethod · 0.65

Tested by

no test coverage detected