about summary refs log tree commit diff
path: root/Completion/Builtins/_wait
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-06-27 05:33:04 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-06-27 05:33:04 +0000
commit346825df86466cf151be61b9429ef2c1734e66ea (patch)
treebd3e1ccd947b47f974c62b4113c5276416de2c9f /Completion/Builtins/_wait
parenta2159285e80508bb682d90a71270fbddada8bd05 (diff)
downloadzsh-346825df86466cf151be61b9429ef2c1734e66ea.tar.gz
zsh-346825df86466cf151be61b9429ef2c1734e66ea.tar.xz
zsh-346825df86466cf151be61b9429ef2c1734e66ea.zip
zsh-3.1.5-pws-24 zsh-3.1.5-pws-24
Diffstat (limited to 'Completion/Builtins/_wait')
-rw-r--r--Completion/Builtins/_wait15
1 files changed, 13 insertions, 2 deletions
diff --git a/Completion/Builtins/_wait b/Completion/Builtins/_wait
index 41d09c9b2..8f9339ebd 100644
--- a/Completion/Builtins/_wait
+++ b/Completion/Builtins/_wait
@@ -1,9 +1,20 @@
 #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
 
 compgen -P '%' -j && ret=0
-list=("$(ps 2>/dev/null)")
-compgen -y '$list' -s '${${${(f)"$(ps 2>/dev/null)"}[2,-1]## #}%% *}' && ret=0
+list=("${(@Mr:COLUMNS-1:)${(f)$(ps ${compconfig[ps_listargs]:-$compconfig[ps_args]} 2>/dev/null)}[2,-1]:#[ 	]#${PREFIX}[0-9]#${SUFFIX}[ 	]*}")
+compadd -y list - ${${${(f)"$(ps $compconfig[ps_args] 2>/dev/null)"}[2,-1]## #}%% *} && ret=0
 
 return ret