summaryrefslogtreecommitdiff
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
parent56fffd548203c3257d9fe05d75e36d8002b48bcc (diff)
downloadzsh-7ec05332a281ab0229a864bb4ccc4571e4f8ca1b.tar.gz
zsh-7ec05332a281ab0229a864bb4ccc4571e4f8ca1b.zip
45939: Add _pgids type
-rw-r--r--ChangeLog7
-rw-r--r--Completion/Linux/Command/_ionice4
-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
6 files changed, 17 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index b1d58021b..ac6ccc445 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2020-06-01 Matthew Martin <phy1729@gmail.com>
+
+ * 45939: Completion/Linux/Command/_ionice,
+ Completion/Unix/Command/_lsof, Completion/Unix/Command/_pgrep,
+ Completion/Unix/Command/_renice, Completion/Unix/Type/_pgids:
+ Add _pgids type.
+
2020-06-01 Doron Behar <doron.behar@gmail.com>
* gitlab !14: Completion/Linux/Command/_modutils: modutils
diff --git a/Completion/Linux/Command/_ionice b/Completion/Linux/Command/_ionice
index d64f1c496..ba403ca56 100644
--- a/Completion/Linux/Command/_ionice
+++ b/Completion/Linux/Command/_ionice
@@ -17,14 +17,14 @@ _arguments -C -s -S \
'(- *)'{-h,--help}'[display help information]' \
+ '(args)' \
'(H)'{-p-,--pid=-}'[interpret args as process ID]::process id:_pids' \
- '(H)'{-P-,--pgid=-}'[specify process group IDs]::process group' \
+ '(H)'{-P-,--pgid=-}'[specify process group IDs]::process group:_pgids' \
'(H)'{-u-,--uid=-}'[act on running process owned by specified users]::user id' && ret=0
if [[ -n $state ]]; then
if (( $+opt_args[args--p] || $+opt_args[args---pid] )); then
_pids && ret=0
elif (( $+opt_args[args--P] || $+opt_args[args---pgid] )); then
- _message -e pgids 'process group'
+ _pgids && ret=0
elif (( $+opt_args[args--u] || $+opt_args[args---uid] )); then
_message -e uids 'user id'
else
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=)}