container: completion: add plugins arg type support
This commit is contained in:
@@ -77,8 +77,14 @@ function docker-finance::completion()
|
|||||||
mapfile -t _reply < <(compgen -W "help" -- "$_cur")
|
mapfile -t _reply < <(compgen -W "help" -- "$_cur")
|
||||||
;;
|
;;
|
||||||
plugins)
|
plugins)
|
||||||
|
[ -z "$DOCKER_FINANCE_CONTAINER_REPO" ] && lib_utils::die_fatal
|
||||||
|
[ -z "$DOCKER_FINANCE_CONTAINER_PLUGINS" ] && lib_utils::die_fatal
|
||||||
|
|
||||||
local _plugins
|
local _plugins
|
||||||
mapfile -t _plugins < <(find "${DOCKER_FINANCE_CONTAINER_FLOW}"/plugins -type f -executable -printf '%P\n' 2>/dev/null)
|
mapfile -t _plugins < <({
|
||||||
|
find "${DOCKER_FINANCE_CONTAINER_PLUGINS}"/finance -type f -executable -printf 'custom/%P\n' 2>/dev/null
|
||||||
|
find "${DOCKER_FINANCE_CONTAINER_REPO}"/plugins/finance -type f -executable -printf 'repo/%P\n' 2>/dev/null
|
||||||
|
})
|
||||||
declare -r _plugins
|
declare -r _plugins
|
||||||
mapfile -t _reply < <(compgen -W "${_plugins[*]}" -- "$_cur")
|
mapfile -t _reply < <(compgen -W "${_plugins[*]}" -- "$_cur")
|
||||||
;;
|
;;
|
||||||
|
|||||||
Reference in New Issue
Block a user