Add comment explaining compl_func_args
parent
fe26adf7ac
commit
fbc8f7ddf4
|
|
@ -63,9 +63,13 @@ function alias_completion {
|
||||||
local compl_func="${new_completion/#* -F /}"; compl_func="${compl_func%% *}"
|
local compl_func="${new_completion/#* -F /}"; compl_func="${compl_func%% *}"
|
||||||
# avoid recursive call loops by ignoring our own functions
|
# avoid recursive call loops by ignoring our own functions
|
||||||
if [[ "${compl_func#_$namespace::}" == $compl_func ]]; then
|
if [[ "${compl_func#_$namespace::}" == $compl_func ]]; then
|
||||||
|
# the completion function stored in compl_func may need argument(s),
|
||||||
|
# in which case they should be provided in compl_func_args (see #1497)
|
||||||
|
local compl_func_args=
|
||||||
if [[ $compl_func == _filedir_xspec ]]; then
|
if [[ $compl_func == _filedir_xspec ]]; then
|
||||||
compl_func_args=$alias_cmd
|
compl_func_args=$alias_cmd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local compl_wrapper="_${namespace}::${alias_name}"
|
local compl_wrapper="_${namespace}::${alias_name}"
|
||||||
echo "function $compl_wrapper {
|
echo "function $compl_wrapper {
|
||||||
(( COMP_CWORD += ${#alias_arg_words[@]} ))
|
(( COMP_CWORD += ${#alias_arg_words[@]} ))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue