container: bash: completion: add plugins support
This commit is contained in:
@@ -28,7 +28,7 @@ function docker-finance::completion()
|
|||||||
mapfile -t _profiles < <(pushd "${DOCKER_FINANCE_CONTAINER_FLOW}"/profiles &>/dev/null && ls -d */*)
|
mapfile -t _profiles < <(pushd "${DOCKER_FINANCE_CONTAINER_FLOW}"/profiles &>/dev/null && ls -d */*)
|
||||||
declare -r _profiles
|
declare -r _profiles
|
||||||
|
|
||||||
local -r _commands=("all" "edit" "fetch" "import" "ledger" "ledger-ui" "ledger-web" "meta" "reports" "root" "taxes")
|
local -r _commands=("all" "edit" "fetch" "import" "ledger" "ledger-ui" "ledger-web" "meta" "plugins" "reports" "root" "taxes")
|
||||||
|
|
||||||
local _reply
|
local _reply
|
||||||
|
|
||||||
@@ -76,6 +76,12 @@ function docker-finance::completion()
|
|||||||
# NOTE: args are dependent upon metadata contents
|
# NOTE: args are dependent upon metadata contents
|
||||||
mapfile -t _reply < <(compgen -W "help" -- "$_cur")
|
mapfile -t _reply < <(compgen -W "help" -- "$_cur")
|
||||||
;;
|
;;
|
||||||
|
plugins)
|
||||||
|
local _plugins
|
||||||
|
mapfile -t _plugins < <(find "${DOCKER_FINANCE_CONTAINER_FLOW}"/plugins -type f -executable -printf '%P\n' 2>/dev/null)
|
||||||
|
declare -r _plugins
|
||||||
|
mapfile -t _reply < <(compgen -W "${_plugins[*]}" -- "$_cur")
|
||||||
|
;;
|
||||||
reports)
|
reports)
|
||||||
mapfile -t _reply < <(compgen -W "help all${global_arg_delim_2} type${global_arg_delim_2} interval${global_arg_delim_2} year${global_arg_delim_2}" -- "$_cur")
|
mapfile -t _reply < <(compgen -W "help all${global_arg_delim_2} type${global_arg_delim_2} interval${global_arg_delim_2} year${global_arg_delim_2}" -- "$_cur")
|
||||||
;;
|
;;
|
||||||
|
|||||||
Reference in New Issue
Block a user