()
| 29 | const UserWithNoOrganizationMsg = "you are not part of any organization, please run \"chainloop organization create --name ORG_NAME\" to create one" |
| 30 | |
| 31 | func newOrganizationList() *cobra.Command { |
| 32 | cmd := &cobra.Command{ |
| 33 | Use: "list", |
| 34 | Aliases: []string{"ls"}, |
| 35 | Short: "List the organizations this user has access to", |
| 36 | RunE: func(cmd *cobra.Command, args []string) error { |
| 37 | res, err := action.NewMembershipList(ActionOpts).ListOrgs(cmd.Context()) |
| 38 | if err != nil { |
| 39 | return err |
| 40 | } |
| 41 | |
| 42 | return output.EncodeOutput(flagOutputFormat, res, orgMembershipTableOutput) |
| 43 | }, |
| 44 | } |
| 45 | |
| 46 | return cmd |
| 47 | } |
| 48 | |
| 49 | func orgMembershipTableOutput(items []*action.MembershipItem) error { |
| 50 | if len(items) == 0 { |
no test coverage detected