MCPcopy Index your code
hub / github.com/devopsctl/gitlabctl / printGroupsOut

Function printGroupsOut

cmd/helpers.go:163–186  ·  view source on GitHub ↗
(format string, groups ...*gitlab.Group)

Source from the content-addressed store, hash-verified

161}
162
163func printGroupsOut(format string, groups ...*gitlab.Group) {
164 switch format {
165 case JSON:
166 printJSON(groups)
167 case YAML:
168 printYAML(groups)
169 default:
170 if len(groups) == 0 {
171 fmt.Println(noResultMsg)
172 return
173 }
174 header := []string{"ID", "PATH", "URL", "PARENT ID"}
175 var rows [][]string
176 for _, v := range groups {
177 rows = append(rows, []string{
178 iToS(v.ID),
179 v.FullPath,
180 v.WebURL,
181 iToS(v.ParentID),
182 })
183 }
184 printTable(header, rows)
185 }
186}
187
188func printProjectsOut(format string, projects ...*gitlab.Project) {
189 switch format {

Callers 5

runDescGroupFunction · 0.85
runGetGroupsFunction · 0.85
runGetSubgroupsFunction · 0.85
runNewGroupFunction · 0.85
runEditGroupFunction · 0.85

Calls 4

printJSONFunction · 0.85
printYAMLFunction · 0.85
iToSFunction · 0.85
printTableFunction · 0.85

Tested by

no test coverage detected