blob: 0b58367f10e8935abfa834d31f4dc42503f9989c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#compdef wait
local tags list ret=1 expl
_tags job process
while _tags; do
[[ "$tags" = *:job:* ]] && _jobs && ret=0
if [[ "$tags" = *:process:* ]]; then
list=("${(@M)${(f@)$(ps ${=compconfig[ps_listargs]:-$=compconfig[ps_args]} 2>/dev/null)}[2,-1]:#[ ]#${PREFIX}[0-9]#${SUFFIX}[ ]*}")
_description expl 'process ID'
compadd "$expl[@]" -ld list - \
${${${(f)"$(ps $=compconfig[ps_args] 2>/dev/null)"}[2,-1]## #}%% *} &&
ret=0
fi
(( ret )) || break
done
return ret
|