summaryrefslogtreecommitdiff
path: root/cmd/podman/common/completion.go
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2022-06-16 20:05:27 +0000
committerGitHub <noreply@github.com>2022-06-16 20:05:27 +0000
commit2af8851787d2c34d6264945372deaec4c387882a (patch)
tree29d25cc8cd50f804a36fa9f3d98032d5333757fb /cmd/podman/common/completion.go
parent5cba4dc2e490b5c652ba0821067b63d7b2e4cf8f (diff)
parent958759a71955860b01b17bd3bebf38f9dae1018e (diff)
downloadpodman-2af8851787d2c34d6264945372deaec4c387882a.tar.gz
podman-2af8851787d2c34d6264945372deaec4c387882a.tar.bz2
podman-2af8851787d2c34d6264945372deaec4c387882a.zip
Merge pull request #14299 from cdoern/podClone
implement podman pod clone
Diffstat (limited to 'cmd/podman/common/completion.go')
-rw-r--r--cmd/podman/common/completion.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/podman/common/completion.go b/cmd/podman/common/completion.go
index 07dcc4e6a..aeb051001 100644
--- a/cmd/podman/common/completion.go
+++ b/cmd/podman/common/completion.go
@@ -1607,8 +1607,14 @@ func AutocompleteClone(cmd *cobra.Command, args []string, toComplete string) ([]
}
switch len(args) {
case 0:
+ if cmd.Parent().Name() == "pod" { // needs to be " pod " to exclude 'podman'
+ return getPods(cmd, toComplete, completeDefault)
+ }
return getContainers(cmd, toComplete, completeDefault)
case 2:
+ if cmd.Parent().Name() == "pod" {
+ return nil, cobra.ShellCompDirectiveNoFileComp
+ }
return getImages(cmd, toComplete)
}
return nil, cobra.ShellCompDirectiveNoFileComp