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

Method PrintUsers

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

Source from the content-addressed store, hash-verified

52}
53
54func (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}

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