Merge pull request #9269 from Luap99/rootfs-shell-completion

Allow path completion for podman create/run --rootfs
This commit is contained in:
OpenShift Merge Robot 2021-02-09 04:25:30 -05:00 committed by GitHub
commit 9da4169e31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -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