MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / newOrganizationList

Function newOrganizationList

app/cli/cmd/organization_list.go:31–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29const UserWithNoOrganizationMsg = "you are not part of any organization, please run \"chainloop organization create --name ORG_NAME\" to create one"
30
31func 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
49func orgMembershipTableOutput(items []*action.MembershipItem) error {
50 if len(items) == 0 {

Callers 1

newOrganizationCmdFunction · 0.85

Calls 4

NewMembershipListFunction · 0.92
EncodeOutputFunction · 0.92
ListOrgsMethod · 0.80
ContextMethod · 0.80

Tested by

no test coverage detected