summaryrefslogtreecommitdiff
path: root/cmd/podman/common/completion.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-09-23 10:51:44 -0400
committerGitHub <noreply@github.com>2021-09-23 10:51:44 -0400
commitc2beea695857b71250c87eb9ab799f7773b8d251 (patch)
tree99f0dafe0248bc4c115d308b31f8c0dc3fb0ad68 /cmd/podman/common/completion.go
parent6b8371b1a3a7364d0527d5d87a8aa9a3d1294ac9 (diff)
parentb6e5a4909a5070f3092f91a592e6d04c5d358e85 (diff)
downloadpodman-c2beea695857b71250c87eb9ab799f7773b8d251.tar.gz
podman-c2beea695857b71250c87eb9ab799f7773b8d251.tar.bz2
podman-c2beea695857b71250c87eb9ab799f7773b8d251.zip
Merge pull request #11721 from Luap99/image-completion
shell completion: do not show images without tag
Diffstat (limited to 'cmd/podman/common/completion.go')
-rw-r--r--cmd/podman/common/completion.go7
1 files changed, 0 insertions, 7 deletions
diff --git a/cmd/podman/common/completion.go b/cmd/podman/common/completion.go
index 2ea5fa10f..90522438d 100644
--- a/cmd/podman/common/completion.go
+++ b/cmd/podman/common/completion.go
@@ -194,21 +194,14 @@ func getImages(cmd *cobra.Command, toComplete string) ([]string, cobra.ShellComp
} else {
// suggested "registry.fedoraproject.org/f29/httpd:latest" as
// - "registry.fedoraproject.org/f29/httpd:latest"
- // - "registry.fedoraproject.org/f29/httpd"
// - "f29/httpd:latest"
- // - "f29/httpd"
// - "httpd:latest"
- // - "httpd"
paths := strings.Split(repo, "/")
for i := range paths {
suggestionWithTag := strings.Join(paths[i:], "/")
if strings.HasPrefix(suggestionWithTag, toComplete) {
suggestions = append(suggestions, suggestionWithTag)
}
- suggestionWithoutTag := strings.SplitN(strings.SplitN(suggestionWithTag, ":", 2)[0], "@", 2)[0]
- if strings.HasPrefix(suggestionWithoutTag, toComplete) {
- suggestions = append(suggestions, suggestionWithoutTag)
- }
}
}
}