diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-02-22 10:10:49 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-22 10:10:49 -0500 |
commit | fab82a7c9ca3821c2b4496f9e9f6bfc8b2aff53d (patch) | |
tree | 7bafc1608557fd8f98970eaece2225b0d4820edb /cmd/podman/common/completion.go | |
parent | 948dfc6f02b7b15547a42e39760b04eca20b193d (diff) | |
parent | 94df7015121759ce69f35f7e7735aa2e4a2dc71a (diff) | |
download | podman-fab82a7c9ca3821c2b4496f9e9f6bfc8b2aff53d.tar.gz podman-fab82a7c9ca3821c2b4496f9e9f6bfc8b2aff53d.tar.bz2 podman-fab82a7c9ca3821c2b4496f9e9f6bfc8b2aff53d.zip |
Merge pull request #13059 from cdoern/clone
Implement Podman Container Clone
Diffstat (limited to 'cmd/podman/common/completion.go')
-rw-r--r-- | cmd/podman/common/completion.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cmd/podman/common/completion.go b/cmd/podman/common/completion.go index a2ce3834d..9ebdcda2b 100644 --- a/cmd/podman/common/completion.go +++ b/cmd/podman/common/completion.go @@ -1308,3 +1308,17 @@ func AutocompleteCompressionFormat(cmd *cobra.Command, args []string, toComplete types := []string{"gzip", "zstd", "zstd:chunked"} return types, cobra.ShellCompDirectiveNoFileComp } + +// AutocompleteClone - Autocomplete container and image names +func AutocompleteClone(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + if !validCurrentCmdLine(cmd, args, toComplete) { + return nil, cobra.ShellCompDirectiveNoFileComp + } + switch len(args) { + case 0: + return getContainers(cmd, toComplete, completeDefault) + case 2: + return getImages(cmd, toComplete) + } + return nil, cobra.ShellCompDirectiveNoFileComp +} |