MCPcopy
hub / github.com/containers/toolbox / completionContainerNames

Function completionContainerNames

src/cmd/completion.go:74–84  ·  view source on GitHub ↗
(_ *cobra.Command, _ []string, _ string)

Source from the content-addressed store, hash-verified

72}
73
74func completionContainerNames(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) {
75 var containerNames []string
76 if containers, err := getContainers(); err == nil {
77 for _, container := range containers {
78 name := container.Name()
79 containerNames = append(containerNames, name)
80 }
81 }
82
83 return containerNames, cobra.ShellCompDirectiveNoFileComp
84}
85
86func completionContainerNamesFiltered(cmd *cobra.Command, args []string, _ string) ([]string, cobra.ShellCompDirective) {
87 if cmd.Name() == "enter" && len(args) >= 1 {

Callers

nothing calls this directly

Calls 2

getContainersFunction · 0.85
NameMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…