summary refs log tree commit diff
path: root/Completion/Builtins/_pids
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2000-04-01 20:43:43 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2000-04-01 20:43:43 +0000
commite025336f2f6d9f107ee1e03b9900f04af0544ba9 (patch)
tree37b0ce74587d42d4bcb024991526d2361fcdf04a /Completion/Builtins/_pids
parent20c5fbe688f24010c578c48d4b4d228f0e1a56c3 (diff)
downloadzsh-e025336f2f6d9f107ee1e03b9900f04af0544ba9.tar.gz
zsh-e025336f2f6d9f107ee1e03b9900f04af0544ba9.tar.xz
zsh-e025336f2f6d9f107ee1e03b9900f04af0544ba9.zip
Updated from list as far as 10376
Diffstat (limited to 'Completion/Builtins/_pids')
-rw-r--r--Completion/Builtins/_pids26
1 files changed, 21 insertions, 5 deletions
diff --git a/Completion/Builtins/_pids b/Completion/Builtins/_pids
index 0ffda900b..7dec90e7d 100644
--- a/Completion/Builtins/_pids
+++ b/Completion/Builtins/_pids
@@ -3,16 +3,32 @@
 # If given the `-m <pattern>' option, this tries to complete only pids
 # of processes whose command line match the `<pattern>'.
 
-local list expl match
+local out list expl match desc listargs args
+
+_wanted processes || return 1
 
 if [[ "$1" = -m ]]; then
   match="${2}*"
   shift 2
 fi
 
-_description expl 'process ID'
+zstyle -s ":completion:${curcontext}:pids" command args
+
+out="$(_call pids ps 2>/dev/null)"
 
-list=("${(@Mr:COLUMNS-1:)${(f@)$(ps ${=compconfig[ps_listargs]:-$=compconfig[ps_args]} 2>/dev/null)}[2,-1]:#[ 	]#${PREFIX}[0-9]#${SUFFIX}[ 	]*${~match}}")
+if zstyle -T ":completion:${curcontext}:processes" verbose; then
+  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@)$(_call pids-list ps 2>/dev/null)}[2,-1]:#[ 	]#${PREFIX}[0-9]#${SUFFIX}[ 	]*${~match}}")
+  fi
+  desc=(-ld list)
+else
+  desc=()
+fi
 
-compadd "$expl[@]" "$@" -ld list - \
-  ${${${(M)${(f)"$(ps $=compconfig[ps_args] 2>/dev/null)"}[2,-1]:#*${~match}}## #}%% *}
+_all_labels processes expl 'process ID' \
+    compadd "$@" "$desc[@]" - \
+        ${${${(M)${(f)"${out}"}[2,-1]:#[ 	]#${PREFIX}[0-9]#${SUFFIX}[ 	]#*${~match}}## #}%% *}