Skip to content

Commit cad0775

Browse files
scopakinomyoga
authored andcommitted
feat(bash_completion): scratch _comp_return_hook
1 parent 9af2118 commit cad0775

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

bash_completion

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,14 @@ _comp_variable_assignments()
987987
return 0
988988
}
989989

990+
_comp_return_hook()
991+
{
992+
((${#FUNCNAME[*]} != 2)) && return # this _will_ need some refinement and thought
993+
echo "Hello from return hook for ${FUNCNAME[1]}"
994+
echo "words: ${words[@]}"
995+
echo "COMPREPLY: ${COMPREPLY[@]}"
996+
}
997+
990998
# Initialize completion and deal with various general things: do file
991999
# and variable completion where appropriate, and adjust prev, words,
9921000
# and cword as if no redirections exist so that completions do not
@@ -1020,6 +1028,8 @@ _comp_initialize()
10201028
{
10211029
local exclude="" opt_split="" outx errx inx
10221030

1031+
trap _comp_return_hook RETURN
1032+
10231033
local flag OPTIND=1 OPTARG="" OPTERR=0
10241034
while getopts "n:e:o:i:s" flag "$@"; do
10251035
case $flag in

0 commit comments

Comments
 (0)