5 local soptions
="-opengl -connect -mousegrab -bandwidth
6 -bindaddr -clientport -config -compress
7 -consisdump -console -coopsound -debug
8 -debugfile -dedicated -extratic -framebuffer
9 -freq -gametype -gettickcount -height -home
10 -internetserver -ipx -maxdemo -noblit -nodigimusic
11 -nodinput -nodownload -nodownloading -nodraw
12 -noendtxt -noerror -nofiles -nojoy -nomidimusic
13 -nomouse -nomusic -nosound -openal -packetsize
14 -password -playdemo -precachesound -record
15 -resetdata -room -server -silent -sounddriver
16 -timedemo -timetic -udpport -ultimatemode -usecd
17 -voodoo -warp -width -win -winmidi"
18 local moptions
="-file"
20 local cur
=`_get_cword`
21 local prev
="${COMP_WORDS[COMP_CWORD-1]}"
30 "-file" |
"-config" |
"-home")
34 if [[ -e "/usr/bin/xclip" ]]; then
36 if [[ "$addr" == *.
*.
*.
* ]]; then
45 if [[ "$cur" == -* ]]; then
46 COMPREPLY
=($
(compgen
-W "$soptions $moptions" -- "$cur"))
48 for ((i
=1; i
< ${#COMP_WORDS[@]}-1; i
++)); do
49 for sopt
in $soptions; do
50 if [[ "$sopt" == "${COMP_WORDS[i]}" ]]; then
51 for r
in ${!COMPREPLY[@]}; do
52 if [[ "$sopt" == "${COMPREPLY[r]}" ]]; then
61 for ((i
=${#COMP_WORDS[@]}-1; i
>= 0; i--
)); do
62 if [[ "${COMP_WORDS[i]}" == -* ]]; then
63 if [[ "${COMP_WORDS[i]}" == "-file" ]]; then
78 complete
$filenames -F _srb2 srb2