(cmd *cobra.Command, args []string, _ string)
| 84 | } |
| 85 | |
| 86 | func completionContainerNamesFiltered(cmd *cobra.Command, args []string, _ string) ([]string, cobra.ShellCompDirective) { |
| 87 | if cmd.Name() == "enter" && len(args) >= 1 { |
| 88 | return nil, cobra.ShellCompDirectiveNoFileComp |
| 89 | } |
| 90 | |
| 91 | var containerNames []string |
| 92 | if containers, err := getContainers(); err == nil { |
| 93 | for _, container := range containers { |
| 94 | name := container.Name() |
| 95 | skip := false |
| 96 | for _, arg := range args { |
| 97 | if name == arg { |
| 98 | skip = true |
| 99 | break |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | if skip { |
| 104 | continue |
| 105 | } |
| 106 | |
| 107 | containerNames = append(containerNames, name) |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | return containerNames, cobra.ShellCompDirectiveNoFileComp |
| 112 | |
| 113 | } |
| 114 | |
| 115 | func completionDistroNames(cmd *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { |
| 116 | imageFlag := cmd.Flag("image") |
nothing calls this directly
no test coverage detected
searching dependent graphs…