MCPcopy Index your code
hub / github.com/rilldata/rill / AddGroup

Function AddGroup

cli/pkg/cmdutil/group.go:6–25  ·  view source on GitHub ↗

AddGroup adds a group of commands to the parent command.

(parent *cobra.Command, title string, hidden bool, children ...*cobra.Command)

Source from the content-addressed store, hash-verified

4
5// AddGroup adds a group of commands to the parent command.
6func AddGroup(parent *cobra.Command, title string, hidden bool, children ...*cobra.Command) {
7 // If the group is hidden, add the children directly to the parent.
8 if hidden {
9 for _, child := range children {
10 parent.AddCommand(child)
11 }
12 return
13 }
14
15 group := &cobra.Group{ID: title, Title: title}
16
17 // Add add the group to the parent command.
18 parent.AddGroup(group)
19
20 // Add the child commands to the group.
21 for _, child := range children {
22 child.GroupID = title
23 parent.AddCommand(child)
24 }
25}

Callers 1

RootCmdFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected