MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / selectTeams

Function selectTeams

pkg/cmd/space/create/create.go:171–188  ·  view source on GitHub ↗
(ask question.Asker, getAllTeamsCallback shared.GetAllTeamsCallback, existingSpaces []*spaces.Space, message string)

Source from the content-addressed store, hash-verified

169}
170
171func selectTeams(ask question.Asker, getAllTeamsCallback shared.GetAllTeamsCallback, existingSpaces []*spaces.Space, message string) ([]*teams.Team, error) {
172 systemTeams, err := getAllTeamsCallback()
173 if err != nil {
174 return []*teams.Team{}, err
175 }
176
177 return question.MultiSelectMap(ask, message, systemTeams, func(team *teams.Team) string {
178 if len(team.SpaceID) == 0 {
179 return fmt.Sprintf("%s %s", team.Name, output.Dim("(System Team)"))
180 }
181 for _, existingSpace := range existingSpaces {
182 if team.SpaceID == existingSpace.ID {
183 return fmt.Sprintf("%s %s", team.Name, output.Dimf("(%s)", existingSpace.Name))
184 }
185 }
186 return ""
187 }, false)
188}
189
190func selectUsers(ask question.Asker, getAllUsersCallback shared.GetAllUsersCallback, message string) ([]*users.User, error) {
191 existingUsers, err := getAllUsersCallback()

Callers 1

PromptMissingFunction · 0.85

Calls 3

MultiSelectMapFunction · 0.92
DimFunction · 0.92
DimfFunction · 0.92

Tested by

no test coverage detected