mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-01 21:51:40 +02:00
45939: Add _pgids type
This commit is contained in:
parent
56fffd5482
commit
7ec05332a2
6 changed files with 17 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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' \
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
5
Completion/Unix/Type/_pgids
Normal file
5
Completion/Unix/Type/_pgids
Normal file
|
@ -0,0 +1,5 @@
|
|||
#autoload
|
||||
|
||||
local expl
|
||||
|
||||
_wanted pgids expl 'process group ID' compadd "$@" - ${(un)$(_call_program pgids ps -A -o pgid=)}
|
Loading…
Reference in a new issue