1
# bash completion for bumblebee
4
local i prev cur last_optirun_offset compress_types in_option
7
# the position of the last optirun arguments part
9
compress_types='proxy jpeg rgb xv yuv'
11
for (( i=1; i<=COMP_CWORD; i++ )); do
12
prev="${COMP_WORDS[i-1]}"
13
cur="${COMP_WORDS[i]}"
19
-c|--vgl-compress|--failsafe|--display|-d|--config|-C|--ldpath|-l|--primus-ldpath|--socket|-s|-b|--bridge)
29
[[ "$cur" != -* ]] && break
32
last_optirun_offset=$i
35
if [ $last_optirun_offset -eq $COMP_CWORD ]; then
38
COMPREPLY=( $(compgen -W "auto primus virtualgl" -- "$cur") )
41
COMPREPLY=( $(compgen -W "$compress_types" -- "$cur") )
44
COMPREPLY=( $(compgen -W "true false" -- "$cur") )
47
# XXX: find active bumblebee X servers and suggest these
49
-C|--config|-s|--socket)
52
-l|--ldpath|--primus-ldpath)
55
COMPREPLY=( $(compgen -W "--vgl-compress -c --failsafe --quiet \
56
--silent -q --verbose -v --display -d --config -C --ldpath -l \
57
--primus-ldpath --socket -s --help -h --" -- "$cur") )
63
# after the options, auto-complete command
66
have optirun && complete -F _optirun optirun