about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorKosuke Asami <tfortress58@gmail.com>2014-03-12 02:04:06 +0900
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2014-03-13 20:01:15 +0000
commitde68b6bbf1cf7e4fc1e88ec87529700b53c46380 (patch)
tree7e688f4abcede98fbc345bc14c5c6ea70ba77578 /Completion
parentba44ba6e6fa99582c681cfc69ce4f77838af2bb6 (diff)
downloadzsh-de68b6bbf1cf7e4fc1e88ec87529700b53c46380.tar.gz
zsh-de68b6bbf1cf7e4fc1e88ec87529700b53c46380.tar.xz
zsh-de68b6bbf1cf7e4fc1e88ec87529700b53c46380.zip
32472: new pgrep completion options
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Command/_pgrep36
1 files changed, 34 insertions, 2 deletions
diff --git a/Completion/Unix/Command/_pgrep b/Completion/Unix/Command/_pgrep
index e460202a1..e4bd2e286 100644
--- a/Completion/Unix/Command/_pgrep
+++ b/Completion/Unix/Command/_pgrep
@@ -5,18 +5,29 @@ typeset -A opt_args
 typeset -a arguments
 
 arguments=('-P[parent process id]:parent process id:->ppid' 
+     '-F[match only in process in pidfile]:files:_files'
      '-g[match only in process group ids]:group:->pgid' 
      '-G[match only real group id]:group:_groups' 
+     '-j[match only in processes inside jails]'
+     '-M[extract the name list from the specified core]:files:_files'
+     '-N[extract the name list from the specified system]:files:_files'
      '-s[match only session id]:session id:->sid' 
      '-t[match only controlled by terminal]:terminal device:->tty'
+     '-T[match only in processes specified routing table in rtable]'
      '-u[match only effective user id]:user:_users' 
      '-U[match only real user id]:user:_users' 
            '(-n)-o[oldest process]' 
      '(-o)-n[newest process]' 
+     '-a[include process ancestors in the match list]'
+     '-c[print a count of matching processes]'
      '-f[match against full command line]' 
+     '-i[ignore case distinctions]'
+     '-I[confirmation before attempting to single each process]'
+     '-L[given pidfile must be locked]'
+     '-q[do not write anything to standard output]'
+     '-S[search also in system processes]'
      '-v[negate matching]' 
-     '-x[match exactly]' 
-     '*:process name:->pname')
+     '-x[match exactly]')
 
 if [[ $service == 'pkill' ]]
 then
@@ -27,6 +38,27 @@ then
         '-l[list name in addition to id]')
 fi
 
+local optchars
+case "$OSTYPE" in
+  linux*)
+    optchars="cflvxdnoPgsuUGt"
+    ;;
+  freebsd*)
+    optchars="LSafilnoqvxFGMNPUdgjstu"
+    ;;
+  openbsd*)
+    optchars="flnoqvxdGgPsTtUu"
+    ;;
+  darwin*)
+    optchars="LafilnoqvxFGPUdgtu"
+    ;;
+  *)
+    optchars="flvxdnoPgsuUGt"
+    ;;
+esac
+arguments=( ${(M)arguments:#(|\*)(|\(*\))-[$optchars]*}
+     '*:process name:->pname')
+
 _arguments -s -w $arguments && ret=0
 
 case $state in