Skip to content

Commit

Permalink
Merge pull request containers#9269 from Luap99/rootfs-shell-completion
Browse files Browse the repository at this point in the history
Allow path completion for podman create/run --rootfs
  • Loading branch information
openshift-merge-robot authored Feb 9, 2021
2 parents 58810fb + 1caace8 commit 9da4169
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/podman/common/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9da4169

Please sign in to comment.