5 cur="${COMP_WORDS[COMP_CWORD]}"
6 prev="${COMP_WORDS[COMP_CWORD-1]}"
8 opts="-I -IL -P -w -nw -d -nd -sa -nsa -mv -ms -O -PO -S -PS -ABC -PABC -c -lt -nlt -lat -nlat -lset -ci -nci -ou -nou -fusion -nfusion -pt -npt -desc -exl -tst -funcmayfail -varnotused -funcnotused -nowarn -ns -no-opt-link -l -sl -e -E -aC -h -s -b -sc -t -nt -gc -ngc -st -nst -nr -gcm -gcc -gcf -gci -dynamics -nortsopts -p -pic -optabc -bytecode"
12 # Complete Clean libraries
13 opts="$(find "$CLEAN_HOME/lib" -mindepth 1 -type d -not -name exe -regex ".*/lib/\([^/]*\|Platform/Deprecated/[^/]*\)" | cut -c $((${#CLEAN_HOME}+6))-)"
17 COMPREPLY=($(compgen -W "$opts" -- $cur))
21 # Complete directories
23 for index in "${!COMPREPLY[@]}"; do
24 [ -d "${COMPREPLY[index]}" ] || unset -v 'COMPREPLY[$index]'
31 for index in "${!COMPREPLY[@]}"; do
32 [ -f "${COMPREPLY[index]}" ] || unset -v 'COMPREPLY[$index]'
36 "-P" | "-e" | "-E" | "-h" | "-s" | "-gcf" | "-gci")
42 if [[ $cur == -* ]]; then
44 COMPREPLY=($(compgen -W "$opts" -- $cur))
47 # Main module; complete icl module names
48 opts="$(find -name '*.icl' -maxdepth 4 -type f -print 2>/dev/null | sed 's:^\./::;s:/:.:g;s:\.icl$::' | grep -v '[- ]')"
49 COMPREPLY=($(compgen -W "$opts" -- $cur))