mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-22 16:20:23 +02:00
manual/9897
This commit is contained in:
parent
8fb50dcf4f
commit
d726746c3d
17 changed files with 65 additions and 33 deletions
|
@ -67,7 +67,7 @@ if (( long )); then
|
|||
# those hyphens and anything from the space or comma after the
|
||||
# option up to the end.
|
||||
|
||||
lopts=("--${(@)^${(@)${(@)${(@M)${(@ps:\n:j:\n:)${(@)${(@M)${(@f)$(${~words[1]} --help 2>&1)//\[--/
|
||||
lopts=("--${(@)^${(@)${(@)${(@M)${(@ps:\n:j:\n:)${(@)${(@M)${(@f)$(_call options ${~words[1]} --help 2>&1)//\[--/
|
||||
--}:#[ ]#-*}//,/
|
||||
}}:#[ ]#--*}#*--}%%[], ]*}:#}")
|
||||
lopts=( "${(@)lopts:#--}" )
|
||||
|
|
|
@ -12,17 +12,17 @@ if [[ "$1" = -m ]]; then
|
|||
shift 2
|
||||
fi
|
||||
|
||||
zstyle -a ":completion:${curcontext}:ps" arguments args
|
||||
zstyle -s ":completion:${curcontext}:pids" command args
|
||||
|
||||
out="$(command ps $args 2>/dev/null)"
|
||||
out="$(_call pids ps 2>/dev/null)"
|
||||
|
||||
if zstyle -T ":completion:${curcontext}:processes" verbose; then
|
||||
zstyle -a ":completion:${curcontext}:ps" list-arguments listargs
|
||||
zstyle -s ":completion:${curcontext}:pids-list" command listargs
|
||||
(( $#listargs )) || listargs=( "$args[@]" )
|
||||
if [[ "$listargs" = "$args" ]]; then
|
||||
list=("${(@Mr:COLUMNS-1:)${(f@)out}[2,-1]:#[ ]#${PREFIX}[0-9]#${SUFFIX}[ ]*${~match}}")
|
||||
else
|
||||
list=("${(@Mr:COLUMNS-1:)${(f@)$(command ps $listargs 2>/dev/null)}[2,-1]:#[ ]#${PREFIX}[0-9]#${SUFFIX}[ ]*${~match}}")
|
||||
list=("${(@Mr:COLUMNS-1:)${(f@)$(_call pids-list ps 2>/dev/null)}[2,-1]:#[ ]#${PREFIX}[0-9]#${SUFFIX}[ ]*${~match}}")
|
||||
fi
|
||||
desc=(-ld list)
|
||||
else
|
||||
|
@ -30,4 +30,4 @@ else
|
|||
fi
|
||||
|
||||
compadd "$expl[@]" "$@" "$desc[@]" - \
|
||||
${${${(M)${(f)"$(command ps $args 2>/dev/null)"}[2,-1]:#[ ]#${PREFIX}[0-9]#${SUFFIX}[ ]#*${~match}}## #}%% *}
|
||||
${${${(M)${(f)"${out}"}[2,-1]:#[ ]#${PREFIX}[0-9]#${SUFFIX}[ ]#*${~match}}## #}%% *}
|
||||
|
|
|
@ -190,7 +190,7 @@ while [[ -n "$state" ]]; do
|
|||
;&
|
||||
package)
|
||||
_wanted packages expl 'RPM package' &&
|
||||
compadd "$expl[@]" -M 'r:|-=* r:|=*' - $(rpm -qa) && ret=0
|
||||
compadd "$expl[@]" -M 'r:|-=* r:|=*' - $(_call packages rpm -qa) && ret=0
|
||||
;;
|
||||
package_file)
|
||||
if compset -P ftp://; then
|
||||
|
@ -205,7 +205,7 @@ while [[ -n "$state" ]]; do
|
|||
if compset -P '*\{'; then
|
||||
_wanted tags expl 'RPM tag' &&
|
||||
compadd "$expl[@]" -M 'm:{a-z}={A-Z}' -S '\}' - \
|
||||
"${(@)${(@f)$(rpm --querytags)}#RPMTAG_}" && ret=0
|
||||
"${(@)${(@f)$(_call tags rpm --querytags)}#RPMTAG_}" && ret=0
|
||||
else
|
||||
_message 'RPM format'
|
||||
fi
|
||||
|
|
|
@ -7,7 +7,7 @@ if [[ "$words[1]" != "$_a2ps_cache_cmd" ]]; then
|
|||
|
||||
_a2ps_cache_cmd="$words[1]"
|
||||
|
||||
descr=( "${(@)${(f@)$(LC_ALL=C $words[1] --list=features)//
|
||||
descr=( "${(@)${(f@)$(_call features LC_ALL=C $words[1] --list=features)//
|
||||
/ }:#}" )
|
||||
|
||||
_a2ps_cache_values=(
|
||||
|
|
|
@ -24,7 +24,7 @@ _arguments -C -s \
|
|||
|
||||
case "$state" in
|
||||
serverhost)
|
||||
: ${(A)archie_servers:=${(M)$(archie -L):#archie.*}}
|
||||
: ${(A)archie_servers:=${(M)$(_call hosts archie -L):#archie.*}}
|
||||
|
||||
_wanted hosts expl 'archie servers' && compadd "$expl[@]" - $archie_servers
|
||||
;;
|
||||
|
|
|
@ -4,7 +4,7 @@ local of ofwuc ouc oss ofwy ofwg ofwl
|
|||
|
||||
(( $+_diff_is_gnu )) || {
|
||||
_diff_is_gnu=0;
|
||||
[[ $(command diff -v </dev/null 2>/dev/null) == *GNU* ]] && _diff_is_gnu=1
|
||||
[[ $(_call version diff -v </dev/null 2>/dev/null) == *GNU* ]] && _diff_is_gnu=1
|
||||
}
|
||||
|
||||
if (( _diff_is_gnu ))
|
||||
|
|
|
@ -4,7 +4,7 @@ local curcontext="$curcontext" state line
|
|||
typeset -A opt_args
|
||||
|
||||
if (( ! $+_finger_args )); then
|
||||
local help="$(finger -\? 2>&1)"
|
||||
local help="$(_call options finger -\? 2>&1)"
|
||||
local -A optionmap
|
||||
|
||||
## `finger -\?':
|
||||
|
|
|
@ -7,7 +7,7 @@ _wanted groups expl group || return 1
|
|||
if ! zstyle -a ":completion:${curcontext}:" groups groups; then
|
||||
(( $+_cache_groups )) ||
|
||||
if (( ${+commands[ypcat]} )); then
|
||||
: ${(A)_cache_groups:=${${(s: :)$(ypcat group.byname)}%%:*}} # If you use YP
|
||||
: ${(A)_cache_groups:=${${(s: :)$(_call groups ypcat group.byname)}%%:*}} # If you use YP
|
||||
else
|
||||
: ${(A)_cache_groups:=${${(s: :)$(</etc/group)}%%:*}}
|
||||
fi
|
||||
|
|
|
@ -36,7 +36,7 @@ else
|
|||
case "$IPREFIX" in
|
||||
*DEVICE\=)
|
||||
_wanted devices expl 'ghostscript device' &&
|
||||
compadd "$expl[@]" - "${(@)${=${$(gs -h)##* devices:}%%Search path:*}:#}" && ret=0
|
||||
compadd "$expl[@]" - "${(@)${=${$(_call devices gs -h)##* devices:}%%Search path:*}:#}" && ret=0
|
||||
;;
|
||||
*OutputFile\=)
|
||||
_description files expl 'output file'
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
if [[ "$OSTYPE" = linux* ]]; then
|
||||
_alternative \
|
||||
'signals:: _signals -p' \
|
||||
'processes:process:{ compadd "$expl[@]" ${$(ps ho comm 2> /dev/null):#(ps|COMMAND)} }'
|
||||
'processes:process:{ compadd "$expl[@]" ${$(_call pids ps ho comm 2> /dev/null):#(ps|COMMAND)} }'
|
||||
else
|
||||
_signals -p
|
||||
fi
|
||||
|
|
|
@ -64,7 +64,7 @@ else
|
|||
else
|
||||
printer=()
|
||||
fi
|
||||
list=( ${(M)"${(f@)$(lpq $printer 2> /dev/null)}":#[0-9]*} )
|
||||
list=( ${(M)"${(f@)$(_call jobs lpq $printer 2> /dev/null)}":#[0-9]*} )
|
||||
|
||||
if (( $#list )); then
|
||||
_tags users jobs
|
||||
|
|
|
@ -9,7 +9,7 @@ local curcontext="$curcontext" state line expl
|
|||
typeset -A opt_args
|
||||
|
||||
if (( ! $+_telnet_args )); then
|
||||
local help="$(telnet -\? < /dev/null 2>&1)"
|
||||
local help="$(_call options telnet -\? < /dev/null 2>&1)"
|
||||
local -A optionmap
|
||||
optionmap=(
|
||||
'*\[-8\]*' '-8[allow 8-Bit data]'
|
||||
|
|
|
@ -6,7 +6,7 @@ _tags users || return 1
|
|||
|
||||
if which users >/dev/null; then
|
||||
_description users expl 'users logged on'
|
||||
compadd "$@" "$expl[@]" - $(users) && return 0
|
||||
compadd "$@" "$expl[@]" - $(_call users users) && return 0
|
||||
else
|
||||
# Other methods of finding out users logged on should be added here
|
||||
return 1
|
||||
|
|
|
@ -4,8 +4,8 @@ local curcontext="$curcontext" line state ret=1
|
|||
typeset -A opt_args
|
||||
|
||||
if (( ! $+_yp_cache_maps )); then
|
||||
_yp_cache_maps=( "${(@)${(@f)$(ypwhich -m)}%% *}" )
|
||||
_yp_cache_nicks=( "${(@)${(@)${(@f)$(ypwhich -x)}#*\"}%%\"*}" )
|
||||
_yp_cache_maps=( "${(@)${(@f)$(_call maps ypwhich -m)}%% *}" )
|
||||
_yp_cache_nicks=( "${(@)${(@)${(@f)$(_call names ypwhich -x)}#*\"}%%\"*}" )
|
||||
_yp_args=(
|
||||
'(-x)-d[specify domain]:domain name:' \
|
||||
'(-x)-k[display keys]' \
|
||||
|
|
|
@ -9,7 +9,7 @@ _wanted fonts expl font || return 1
|
|||
if (( ! $+_font_cache )); then
|
||||
typeset -gU _font_cache
|
||||
|
||||
_font_cache=( "${(@)^${(@f)$(xlsfonts)}%%--*}--" )
|
||||
_font_cache=( "${(@)^${(@f)$(_call fonts xlsfonts)}%%--*}--" )
|
||||
fi
|
||||
|
||||
compadd -M 'r:|-=* r:|=*' "$expl[@]" "$@" -S '' - "$_font_cache[@]"
|
||||
|
|
|
@ -4,7 +4,7 @@ local list expl
|
|||
|
||||
_tags windows || return 1
|
||||
|
||||
list=( "${(@)${(M@)${(@f)$(xwininfo -root -tree)}:#[ ]#0x[0-9a-f]# \"*}##[ ]#}" )
|
||||
list=( "${(@)${(M@)${(@f)$(_call windows xwininfo -root -tree)}:#[ ]#0x[0-9a-f]# \"*}##[ ]#}" )
|
||||
|
||||
if [[ "$1" = -n ]]; then
|
||||
shift
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue