summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 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