1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-02 10:01:11 +02:00

45939: Add _pgids type

This commit is contained in:
Matthew Martin 2020-05-29 22:25:08 -05:00
parent 56fffd5482
commit 7ec05332a2
6 changed files with 17 additions and 5 deletions

View file

@ -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

View file

@ -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

View file

@ -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' \

View file

@ -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

View file

@ -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

View file

@ -0,0 +1,5 @@
#autoload
local expl
_wanted pgids expl 'process group ID' compadd "$@" - ${(un)$(_call_program pgids ps -A -o pgid=)}