about summary refs log tree commit diff
path: root/Completion/Unix
diff options
context:
space:
mode:
authorMatthew Martin <phy1729@gmail.com>2020-05-29 22:25:08 -0500
committerMatthew Martin <phy1729@gmail.com>2020-06-01 21:18:23 -0500
commit7ec05332a281ab0229a864bb4ccc4571e4f8ca1b (patch)
treea6174e6c2d6fa97749f8201844b8723a7d06fa4d /Completion/Unix
parent56fffd548203c3257d9fe05d75e36d8002b48bcc (diff)
downloadzsh-7ec05332a281ab0229a864bb4ccc4571e4f8ca1b.tar.gz
zsh-7ec05332a281ab0229a864bb4ccc4571e4f8ca1b.tar.xz
zsh-7ec05332a281ab0229a864bb4ccc4571e4f8ca1b.zip
45939: Add _pgids type
Diffstat (limited to 'Completion/Unix')
-rw-r--r--Completion/Unix/Command/_lsof2
-rw-r--r--Completion/Unix/Command/_pgrep2
-rw-r--r--Completion/Unix/Command/_renice2
-rw-r--r--Completion/Unix/Type/_pgids5
4 files changed, 8 insertions, 3 deletions
diff --git a/Completion/Unix/Command/_lsof b/Completion/Unix/Command/_lsof
index 754012e3b..8afb55e1d 100644
--- a/Completion/Unix/Command/_lsof
+++ b/Completion/Unix/Command/_lsof
@@ -34,7 +34,7 @@ _arguments -C -s -S $args \
   '-f[inhibit listing of kernel file structure info]::info type:->file-structures' \
   '+f[enable listing of kernel file structure info]::info type:->file-structures' \
   '-F[select output fields]:fields:->fields' \
-  '-g[select by process group id]::process group id' \
+  '-g[select by process group id]::process group id:_sequence -s , _pgids' \
   '(*)*-i[select internet files]::address:->addresses' \
   '-K+[select listing of tasks of processes]::value:((i\:ignore\ tasks))' \
   '-k[specify kernel name list file]:kernel file:_files' \
diff --git a/Completion/Unix/Command/_pgrep b/Completion/Unix/Command/_pgrep
index 3b4d082a7..3f00b21dc 100644
--- a/Completion/Unix/Command/_pgrep
+++ b/Completion/Unix/Command/_pgrep
@@ -149,7 +149,7 @@ case $state in
     _pgrep_sequence ppids 'parent process ID' ppid
     ;;
   (pgid)
-    _pgrep_sequence pgids 'process group ID' pgid
+    _sequence _pgids
     ;;
   (projid)
     _pgrep_sequence project-ids 'project ID' project
diff --git a/Completion/Unix/Command/_renice b/Completion/Unix/Command/_renice
index cbdac8cae..3b0457348 100644
--- a/Completion/Unix/Command/_renice
+++ b/Completion/Unix/Command/_renice
@@ -12,7 +12,7 @@ else
   _describe -o option opts && ret=0
 
   case ${(v)words[(I)-?]} in
-    -g) _message -e pgids 'process group ID' && ret=0 ;;
+    -g) _pgids && ret=0 ;;
     -u) _users && ret=0 ;;
     *)  _pids && ret=0;;
   esac
diff --git a/Completion/Unix/Type/_pgids b/Completion/Unix/Type/_pgids
new file mode 100644
index 000000000..25d0c4af0
--- /dev/null
+++ b/Completion/Unix/Type/_pgids
@@ -0,0 +1,5 @@
+#autoload
+
+local expl
+
+_wanted pgids expl 'process group ID' compadd "$@" - ${(un)$(_call_program pgids ps -A -o pgid=)}