MCPcopy Index your code
hub / github.com/docker/cli / operationSubCommands

Function operationSubCommands

cli/cobra.go:282–299  ·  view source on GitHub ↗
(cmd *cobra.Command)

Source from the content-addressed store, hash-verified

280}
281
282func operationSubCommands(cmd *cobra.Command) []*cobra.Command {
283 cmds := []*cobra.Command{}
284 for _, sub := range cmd.Commands() {
285 if isPlugin(sub) {
286 continue
287 }
288 if _, ok := sub.Annotations["category-top"]; ok {
289 if cmd.Parent() == nil {
290 // for now, only use top-commands for the root-command
291 continue
292 }
293 }
294 if sub.IsAvailableCommand() && !sub.HasSubCommands() {
295 cmds = append(cmds, sub)
296 }
297 }
298 return cmds
299}
300
301const defaultTermWidth = 80
302

Callers 1

hasSubCommandsFunction · 0.85

Calls 2

isPluginFunction · 0.85
ParentMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…