summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi/auto-update.go
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2022-06-08 18:53:32 +0200
committerPaul Holzinger <pholzing@redhat.com>2022-06-09 13:46:55 +0200
commit549bffe58d7ef71266bc583f3b87d3f551f96486 (patch)
treeed71375201625417ddfb9a3c80eab6ba88f31714 /pkg/domain/infra/abi/auto-update.go
parent864d46c77ef76241b6f0e0c725a08ec28e7e32bc (diff)
downloadpodman-549bffe58d7ef71266bc583f3b87d3f551f96486.tar.gz
podman-549bffe58d7ef71266bc583f3b87d3f551f96486.tar.bz2
podman-549bffe58d7ef71266bc583f3b87d3f551f96486.zip
shell completion: fix problems with container path completion
When you try to complete a path which exists and it is a file the completion logic did not check the parent dir for other matching file names. To fix that we have to check if the current completion is not a dir and use the parent dir in this case. See the updated test for an example why this is required. Also make sure directories are correctly completed, the shell always adds the "/" as suffix to signal the user that this path is a directory. In this case we do not want to automatically add a space. When the path is a regular file we want the space after the suggestion since there is nothing more to complete. This better matches the normal default shell completion. The test were changed to not assume any particular ordering since this is irrelevant for the shell completion script and there is no guarantee about the ordering. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'pkg/domain/infra/abi/auto-update.go')
0 files changed, 0 insertions, 0 deletions