Skip to content

Commit bdb731a

Browse files
scopakinomyoga
authored andcommitted
feat(bash_completion): scratch _comp_return_hook
1 parent 5c19025 commit bdb731a

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
@@ -968,6 +968,14 @@ _comp_variable_assignments()
968968
return 0
969969
}
970970

971+
_comp_return_hook()
972+
{
973+
((${#FUNCNAME[*]} != 2)) && return # this _will_ need some refinement and thought
974+
echo "Hello from return hook for ${FUNCNAME[1]}"
975+
echo "words: ${words[@]}"
976+
echo "COMPREPLY: ${COMPREPLY[@]}"
977+
}
978+
971979
# Initialize completion and deal with various general things: do file
972980
# and variable completion where appropriate, and adjust prev, words,
973981
# and cword as if no redirections exist so that completions do not
@@ -1001,6 +1009,8 @@ _comp_initialize()
10011009
{
10021010
local exclude="" opt_split="" outx errx inx
10031011

1012+
trap _comp_return_hook RETURN
1013+
10041014
local flag OPTIND=1 OPTARG="" OPTERR=0
10051015
while getopts "n:e:o:i:s" flag "$@"; do
10061016
case $flag in

0 commit comments

Comments
 (0)