Skip to content

Commit 8d46e6f

Browse files
scopakinomyoga
authored andcommitted
feat(bash_completion): scratch _comp_return_hook
1 parent 360b87d commit 8d46e6f

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
@@ -1485,6 +1485,14 @@ _comp_variable_assignments()
14851485
return 0
14861486
}
14871487

1488+
_comp_return_hook()
1489+
{
1490+
((${#FUNCNAME[*]} != 2)) && return # this _will_ need some refinement and thought
1491+
echo "Hello from return hook for ${FUNCNAME[1]}"
1492+
echo "words: ${words[@]}"
1493+
echo "COMPREPLY: ${COMPREPLY[@]}"
1494+
}
1495+
14881496
# Initialize completion and deal with various general things: do file
14891497
# and variable completion where appropriate, and adjust prev, words,
14901498
# and cword as if no redirections exist so that completions do not
@@ -1522,6 +1530,8 @@ _comp_initialize()
15221530
{
15231531
local exclude="" opt_split="" outx="" errx="" inx=""
15241532

1533+
trap _comp_return_hook RETURN
1534+
15251535
local flag OPTIND=1 OPTARG="" OPTERR=0
15261536
while getopts "n:e:o:i:s" flag "$@"; do
15271537
case $flag in

0 commit comments

Comments
 (0)