Skip to content

Commit a746df1

Browse files
scopakinomyoga
authored andcommitted
feat(bash_completion): scratch _comp_return_hook
1 parent 0543d1a commit a746df1

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
@@ -1335,6 +1335,14 @@ _comp_variable_assignments()
13351335
return 0
13361336
}
13371337

1338+
_comp_return_hook()
1339+
{
1340+
((${#FUNCNAME[*]} != 2)) && return # this _will_ need some refinement and thought
1341+
echo "Hello from return hook for ${FUNCNAME[1]}"
1342+
echo "words: ${words[@]}"
1343+
echo "COMPREPLY: ${COMPREPLY[@]}"
1344+
}
1345+
13381346
# Initialize completion and deal with various general things: do file
13391347
# and variable completion where appropriate, and adjust prev, words,
13401348
# and cword as if no redirections exist so that completions do not
@@ -1372,6 +1380,8 @@ _comp_initialize()
13721380
{
13731381
local exclude="" opt_split="" outx="" errx="" inx=""
13741382

1383+
trap _comp_return_hook RETURN
1384+
13751385
local flag OPTIND=1 OPTARG="" OPTERR=0
13761386
while getopts "n:e:o:i:s" flag "$@"; do
13771387
case $flag in

0 commit comments

Comments
 (0)