Skip to content

Commit dae7262

Browse files
scopakinomyoga
authored andcommitted
feat(bash_completion): scratch _comp_return_hook
1 parent 6806708 commit dae7262

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
@@ -887,6 +887,14 @@ _comp_variable_assignments()
887887
return 0
888888
}
889889

890+
_comp_return_hook()
891+
{
892+
((${#FUNCNAME[*]} != 2)) && return # this _will_ need some refinement and thought
893+
echo "Hello from return hook for ${FUNCNAME[1]}"
894+
echo "words: ${words[@]}"
895+
echo "COMPREPLY: ${COMPREPLY[@]}"
896+
}
897+
890898
# Initialize completion and deal with various general things: do file
891899
# and variable completion where appropriate, and adjust prev, words,
892900
# and cword as if no redirections exist so that completions do not
@@ -920,6 +928,8 @@ _comp_initialize()
920928
{
921929
local exclude="" outx errx inx
922930

931+
trap _comp_return_hook RETURN
932+
923933
local flag OPTIND=1 OPTARG="" OPTERR=0
924934
while getopts "n:e:o:i:s" flag "$@"; do
925935
case $flag in

0 commit comments

Comments
 (0)