client: completion: fix/optimize docker images

- Reduces overhead, catches all docker-finance images
- Previously wouldn't catch all space between image name and tag
This commit is contained in:
2024-08-12 19:44:14 -07:00
parent 0c7aaf8cc5
commit e7725b72fd

View File

@@ -31,7 +31,7 @@ function docker-finance::completion()
local _prev="${COMP_WORDS[COMP_CWORD - 1]}"
local _images
mapfile -t _images < <(docker image ls | grep ^docker-finance | cut -d'/' -f2- | cut -d' ' -f1-4 | sed -e 's/ /:/')
mapfile -t _images < <(docker images --format "{{.Repository}}:{{.Tag}}" --filter=reference='docker-finance/*/*:*' | cut -d'/' -f2-)
declare -r _images
local -r _commands=("gen" "edit" "build" "backup" "rm" "up" "down" "start" "stop" "run" "shell" "version" "license" "linter" "doxygen" "plugins")