about summary refs log tree commit diff
path: root/Completion/X/_x_extension
blob: 967938e28a7edb0a221cba49f5f6bc8e8de5f672 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#autoload

local expl

(( $+_xe_cache )) || _xe_cache=( "${(@)${(@f)$(xdpyinfo)}[(r)number of extensions:*,-1][2,(r)default screen number:*][1,-2]//[      ]}" )

_description expl 'X extension'

if [[ "$1" = -a ]]; then
  shift

  compadd "$@" "$expl[@]" -M 'm:{a-z}={A-Z} r:|-=* r:|=*' - all "$_xe_cache[@]"
else
  [[ "$1" = - ]] && shift

  compadd "$@" "$expl[@]" -M 'm:{a-z}={A-Z} r:|-=* r:|=*' - "$_xe_cache[@]"
fi