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

Function assignListGroupOptions

cmd/flags_assigners.go:295–322  ·  view source on GitHub ↗

assignListGroupOptions assigns the flags' values to gitlab.ListGroupsOptions fields. If a flag's default value is not changed by the caller, it's value will not be assigned to the associated gitlab.ListGroupsOptions field.

(cmd *cobra.Command)

Source from the content-addressed store, hash-verified

293// If a flag's default value is not changed by the caller,
294// it's value will not be assigned to the associated gitlab.ListGroupsOptions field.
295func assignListGroupOptions(cmd *cobra.Command) *gitlab.ListGroupsOptions {
296 opts := new(gitlab.ListGroupsOptions)
297 if cmd.Flag("page").Changed {
298 opts.Page = getFlagInt(cmd, "page")
299 }
300 if cmd.Flag("per-page").Changed {
301 opts.PerPage = getFlagInt(cmd, "per-page")
302 }
303 if cmd.Flag("all-available").Changed {
304 opts.AllAvailable = gitlab.Bool(getFlagBool(cmd, "all-available"))
305 }
306 if cmd.Flag("owned").Changed {
307 opts.Owned = gitlab.Bool(getFlagBool(cmd, "owned"))
308 }
309 if cmd.Flag("statistics").Changed {
310 opts.Statistics = gitlab.Bool(getFlagBool(cmd, "statistics"))
311 }
312 if cmd.Flag("sort").Changed {
313 opts.Sort = gitlab.String(getFlagString(cmd, "sort"))
314 }
315 if cmd.Flag("search").Changed {
316 opts.Search = gitlab.String(getFlagString(cmd, "search"))
317 }
318 if cmd.Flag("order-by").Changed {
319 opts.OrderBy = gitlab.String(getFlagString(cmd, "order-by"))
320 }
321 return opts
322}
323
324// assignCreateGroupOptions assigns the flags' values to gitlab.CreateGroupOptions fields.
325// If a flag's default value is not changed by the caller,

Callers 2

runGetGroupsFunction · 0.85
runGetSubgroupsFunction · 0.85

Calls 3

getFlagIntFunction · 0.85
getFlagBoolFunction · 0.85
getFlagStringFunction · 0.85

Tested by

no test coverage detected