2 # shfmt --language-dialect bash --indent 4 --func-next-line
12 ['forward-compatible']=''
15 ['reset-notification']=''
20 local versions=(1.{0..5} 2.{0..1} 3.{0..3} 4.{0..6})
24 ['platform']='android cgl gbm glx surfaceless_egl sl wayland wgl x11_egl'
25 ['api']='gl gles1 gles2 gles3'
26 ['version']="${versions[*]}"
27 ['profile']='core compat none'
28 ['format']='original json'
32 _get_comp_words_by_ref cur prev
34 for opt in ${!opts[*]}; do
35 if [[ $prev == -${opts[$opt]} ]] || [[ $prev == --$opt ]]; then
36 local arg="${args[$opt]}"
37 [[ $arg ]] || continue
38 COMPREPLY=($(compgen -W "$arg" -- "$cur"))
43 if [[ $cur == --* ]]; then
44 COMPREPLY=($(compgen -P '--' -W "${!opts[*]}" -- "${cur:2}"))
45 elif [[ $cur == -* && ${#cur} -gt 1 ]]; then
46 COMPREPLY=($(compgen -P '-' -W "${opts[*]}" -- "${cur:1}"))
48 COMPREPLY=($(compgen -P '-' -W "${opts[*]}" -- "${cur:1}")
49 $(compgen -P '--' -W "${!opts[*]}" -- "${cur:2}"))
52 complete -F _wflinfo wflinfo