Skip to content

Commit 1939b22

Browse files
scopakinomyoga
authored andcommitted
feat(bash_completion): scratch _comp_return_hook
1 parent 3414cb6 commit 1939b22

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
@@ -885,6 +885,14 @@ _comp_variable_assignments()
885885
return 0
886886
}
887887

888+
_comp_return_hook()
889+
{
890+
((${#FUNCNAME[*]} != 2)) && return # this _will_ need some refinement and thought
891+
echo "Hello from return hook for ${FUNCNAME[1]}"
892+
echo "words: ${words[@]}"
893+
echo "COMPREPLY: ${COMPREPLY[@]}"
894+
}
895+
888896
# Initialize completion and deal with various general things: do file
889897
# and variable completion where appropriate, and adjust prev, words,
890898
# and cword as if no redirections exist so that completions do not
@@ -904,6 +912,8 @@ _init_completion()
904912
{
905913
local exclude="" flag outx errx inx OPTIND=1
906914

915+
trap _comp_return_hook RETURN
916+
907917
while getopts "n:e:o:i:s" flag "$@"; do
908918
case $flag in
909919
n) exclude+=$OPTARG ;;

0 commit comments

Comments
 (0)