Add comment explaining compl_func_args

pull/1503/head
Taro Sato 2020-02-23 18:38:06 -08:00
parent fe26adf7ac
commit fbc8f7ddf4
1 changed files with 4 additions and 0 deletions

View File

@ -63,9 +63,13 @@ function alias_completion {
local compl_func="${new_completion/#* -F /}"; compl_func="${compl_func%% *}"
# avoid recursive call loops by ignoring our own functions
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
compl_func_args=$alias_cmd
fi
local compl_wrapper="_${namespace}::${alias_name}"
echo "function $compl_wrapper {
(( COMP_CWORD += ${#alias_arg_words[@]} ))