about summary refs log tree commit diff
path: root/Completion/Builtins/_wait
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-10-26 15:36:10 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-10-26 15:36:10 +0000
commite0b26186f1d3c1a3a580eb7e8a8199c25536f4e6 (patch)
treee4247c2507fa1a135740a3cd02e7405cbdbfa69a /Completion/Builtins/_wait
parent56f338eb8bfd4bcdbf14b495ff8a34425c3527d4 (diff)
downloadzsh-e0b26186f1d3c1a3a580eb7e8a8199c25536f4e6.tar.gz
zsh-e0b26186f1d3c1a3a580eb7e8a8199c25536f4e6.tar.xz
zsh-e0b26186f1d3c1a3a580eb7e8a8199c25536f4e6.zip
manual/8424
Diffstat (limited to 'Completion/Builtins/_wait')
-rw-r--r--Completion/Builtins/_wait17
1 files changed, 3 insertions, 14 deletions
diff --git a/Completion/Builtins/_wait b/Completion/Builtins/_wait
index 17a030dad..68ca187e8 100644
--- a/Completion/Builtins/_wait
+++ b/Completion/Builtins/_wait
@@ -1,21 +1,10 @@
 #compdef wait
 
-# This uses two configuration keys:
-#
-#  ps_args
-#    This can be set to options of the ps(1) command that should be
-#    used when invoking it to get the pids to complete.
-#
-#  ps_listargs
-#    This defaults to the value of the `ps_args' key and defines
-#    options for the ps command that are to be used when creating
-#    the list to display during completion.
-
 local list ret=1 expl
 
-_description expl job
-compgen "$expl[@]" -P '%' -j && ret=0
-list=("${(@Mr:COLUMNS-1:)${(f)$(ps ${=compconfig[ps_listargs]:-$=compconfig[ps_args]} 2>/dev/null)}[2,-1]:#[ 	]#${PREFIX}[0-9]#${SUFFIX}[ 	]*}")
+_job -P '%' && ret=0
+
+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