(items []*action.MembershipItem)
| 47 | } |
| 48 | |
| 49 | func orgMembershipTableOutput(items []*action.MembershipItem) error { |
| 50 | if len(items) == 0 { |
| 51 | fmt.Println(UserWithNoOrganizationMsg) |
| 52 | return nil |
| 53 | } |
| 54 | |
| 55 | // Get the current organization from viper configuration |
| 56 | currentOrg := viper.GetString(confOptions.organization.viperKey) |
| 57 | |
| 58 | t := output.NewTableWriter() |
| 59 | t.AppendHeader(table.Row{"Name", "Current", "Default", "Role", "Default Policy strategy", "Joined At"}) |
| 60 | |
| 61 | for _, i := range items { |
| 62 | current := i.Org.Name == currentOrg |
| 63 | t.AppendRow(table.Row{i.Org.Name, current, i.Default, i.Role, i.Org.PolicyViolationBlockingStrategy, i.CreatedAt.Format(time.RFC822)}) |
| 64 | t.AppendSeparator() |
| 65 | } |
| 66 | |
| 67 | t.Render() |
| 68 | return nil |
| 69 | } |
nothing calls this directly
no test coverage detected