Skip to content

Commit daa9a46

Browse files
scopakinomyoga
authored andcommitted
feat(bash_completion): scratch _comp_return_hook
1 parent 40aa4dc commit daa9a46

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
@@ -974,6 +974,14 @@ _comp_variable_assignments()
974974
return 0
975975
}
976976

977+
_comp_return_hook()
978+
{
979+
((${#FUNCNAME[*]} != 2)) && return # this _will_ need some refinement and thought
980+
echo "Hello from return hook for ${FUNCNAME[1]}"
981+
echo "words: ${words[@]}"
982+
echo "COMPREPLY: ${COMPREPLY[@]}"
983+
}
984+
977985
# Initialize completion and deal with various general things: do file
978986
# and variable completion where appropriate, and adjust prev, words,
979987
# and cword as if no redirections exist so that completions do not
@@ -993,6 +1001,8 @@ _init_completion()
9931001
{
9941002
local exclude="" flag outx errx inx OPTIND=1
9951003

1004+
trap _comp_return_hook RETURN
1005+
9961006
while getopts "n:e:o:i:s" flag "$@"; do
9971007
case $flag in
9981008
n) exclude+=$OPTARG ;;

0 commit comments

Comments
 (0)