1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-20 05:53:52 +01:00
zsh/Completion/X/_xwit

117 lines
3.3 KiB
Plaintext
Raw Normal View History

2000-03-24 12:29:25 +01:00
#compdef xwit
local word=$'[^\0]#\0'
local nul=$'\0'
local guard='-_xwit_guard -${match[1]%?}'
_xwit_guard () {
local opt="$1" o
(( no[$opt]-- ))
for o in ${=eo[$opt]}; do
no[$o]=0
done
:
}
_xwit_compopts () {
compadd "$expl[@]" - ${(k)no[(R)*~0]} ||
compadd "$expl[@]" - ${(k)no}
2000-03-24 12:29:25 +01:00
}
_regex_arguments _xwit_parse \
"/$word/" \
\( \
"/-/+" \
\( "/display$nul/" "$guard" "/$word/" ':option-display:display:_x_display' \
2000-03-24 12:29:25 +01:00
\| "/(sync|pop|open|iconify|unmap|root|current|select|(no|)(save|backingstore|saveunder))$nul/" "$guard" \
\| "/resize$nul/" "$guard" \
"/$word/" ':option-resize-width:width:_message width' \
"/$word/" ':option-resize-height:height:_message height' \
\| "/rows$nul/" "$guard" "/$word/" ':option-rows:rows:_message rows' \
\| "/columns$nul/" "$guard" "/$word/" ':option-columns:columns:_message columns' \
\| "/move$nul/" "$guard" \
"/$word/" ':option-move-x:x:_message x' \
"/$word/" ':option-move-y:y:_message y' \
\| "/rmove$nul/" "$guard" \
"/$word/" ':option-rmove-x:x:_message x' \
"/$word/" ':option-rmove-y:y:_message y' \
\| "/warp$nul/" "$guard" \
"/$word/" ':option-warp-x:x:_message x' \
"/$word/" ':option-warp-y:y:_message y' \
\| "/rwarp$nul/" "$guard" \
"/$word/" ':option-rwarp-x:x:_message x' \
"/$word/" ':option-rwarp-y:y:_message y' \
\| "/colormap$nul/" "$guard" \
"/$word/" ':option-colormap:colormapid:_x_colormapid' \
\| "/(name|label)$nul/" "$guard" \
"/$word/" ':option-name:name:_x_name "$expl[@]"' \
\| "/iconname$nul/" "$guard" \
"/$word/" ':option-name:iconname:_x_name "$expl[@]"' \
\| "/bitmap$nul/" "$guard" \
"/$word/" ':option-bitmap:bitmap file:_files "$expl[@]" -g \*.xbm' \
\| "/mask$nul/" "$guard" \
"/$word/" ':option-mask:mask file:_files "$expl[@]" -g \*.xbm' \
\| "/iconmove$nul/" "$guard" \
"/$word/" ':option-iconmove-x:x:_message x' \
"/$word/" ':option-iconmove-y:y:_message y' \
\| "/id$nul/" "$guard" "/$word/" ':option-id:window id:_x_window' \
2000-03-24 12:29:25 +01:00
\| "/(no|)keyrepeat$nul/" "$guard" \
\( "/[0-9]##$nul/" ':option-keyrepeat-keycode:keycode:[[ -prefix [0-9]# ]] && _message keycode' \
\( "/-$nul/" "/[0-9]##$nul/" ':option-keyrepeat-last-keycode:last keycode:[[ -prefix [0-9]# ]] && _message "last keycode"' \| \) \) \# \
\| "/names$nul/" "$guard" \
"/$word/" ':option-names:window name:_x_window -n' \# \
\| "/[]/" ':options:option:_xwit_compopts' \
2000-03-24 12:29:25 +01:00
\) \
\) \#
_xwit () {
typeset -A no eo
no=(
-display 1
-sync 1
-pop 1 -open 0
-iconify 1
-unmap 1
-root 1
-current 1
-select 1
-save 1
-backingstore 1
-saveunder 1
-nosave 1
-nobackingstore 1
-nosaveunder 1
-resize 1
-rows 1
-columns 1
-move 1
-rmove 1
-warp 1
-rwarp 1
-colormap 1
-name 1 -label 0
-iconname 1
-bitmap 1
-mask 1
-iconmove 1
-id 1
-keyrepeat 1
-nokeyrepeat 1
-names 1
)
eo=(
-root '-root -current -select -id -names'
-current '-root -current -select -id -names'
-select '-root -current -select -id -names'
-id '-root -current -select -id -names'
-names '-root -current -select -id -names'
)
_xwit_parse
}
[[ -o kshautoload ]] || _xwit "$@"