mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-11-19 21:44:11 +01:00
moved from Completion/X/_x_arguments
This commit is contained in:
parent
bdb91af0b9
commit
f9fe751bfc
35
Completion/X/Utility/_x_arguments
Normal file
35
Completion/X/Utility/_x_arguments
Normal file
@ -0,0 +1,35 @@
|
||||
#compdef -P */X11(|R[456])/*
|
||||
|
||||
local ret long xargs opts rawret nm="$compstate[nmatches]"
|
||||
|
||||
xargs=(
|
||||
'-display:display:_x_display'
|
||||
'-geometry:geometry:_x_geometry'
|
||||
)
|
||||
|
||||
(( $# )) || xargs=( "$xargs[@]" '*:default: _default' )
|
||||
|
||||
long=$argv[(I)--]
|
||||
if (( long )); then
|
||||
argv[long]=( "$xargs[@]" -- )
|
||||
else
|
||||
set -- "$@" "$xargs[@]"
|
||||
fi
|
||||
|
||||
opts=()
|
||||
while [[ $1 = -(O*|[CR]) ]]; do
|
||||
opts=($opts $1)
|
||||
[[ $1 = -R ]] && rawret=yes
|
||||
shift
|
||||
done
|
||||
|
||||
_arguments -R "$opts[@]" "$@"
|
||||
|
||||
ret=$?
|
||||
|
||||
if [[ "$ret" = 300 ]]; then
|
||||
compstate[restore]=''
|
||||
[[ -z $rawret ]] && ret=$(( nm == $compstate[nmatches] ))
|
||||
fi
|
||||
|
||||
return ret
|
Loading…
Reference in New Issue
Block a user