diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-02-09 04:25:30 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-09 04:25:30 -0500 |
commit | 9da4169e312bb822a0fbae8e18a0eb7c7eff6e64 (patch) | |
tree | 6ebcecd4718de61c39b8d70f21ca24b3e84db75a /cmd/podman | |
parent | 58810fbfbb1ed37fe05e641887217ee781e31351 (diff) | |
parent | 1caace8f4c0faf09f32a2955ba2fea65c4193e78 (diff) | |
download | podman-9da4169e312bb822a0fbae8e18a0eb7c7eff6e64.tar.gz podman-9da4169e312bb822a0fbae8e18a0eb7c7eff6e64.tar.bz2 podman-9da4169e312bb822a0fbae8e18a0eb7c7eff6e64.zip |
Merge pull request #9269 from Luap99/rootfs-shell-completion
Allow path completion for podman create/run --rootfs
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/common/completion.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/podman/common/completion.go b/cmd/podman/common/completion.go index 09dd74e20..92163efde 100644 --- a/cmd/podman/common/completion.go +++ b/cmd/podman/common/completion.go @@ -426,6 +426,12 @@ func AutocompleteCreateRun(cmd *cobra.Command, args []string, toComplete string) return nil, cobra.ShellCompDirectiveNoFileComp } if len(args) < 1 { + // check if the rootfs flag is set + // if it is set to true provide directory completion + rootfs, err := cmd.Flags().GetBool("rootfs") + if err == nil && rootfs { + return nil, cobra.ShellCompDirectiveFilterDirs + } return getImages(cmd, toComplete) } // TODO: add path completion for files in the image |