2011-11-01 22:14:45 +02:00
|
|
|
# pgrep(1) completion -*- shell-script -*-
|
2011-10-12 23:01:10 +03:00
|
|
|
|
|
|
|
_pgrep()
|
|
|
|
{
|
|
|
|
local cur prev words cword
|
|
|
|
_init_completion || return
|
|
|
|
|
|
|
|
case $prev in
|
|
|
|
-d|-g|-s|-t)
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
-G)
|
|
|
|
_gids
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
-P)
|
|
|
|
_pids
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
-u|-U)
|
|
|
|
_uids
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [[ $cur == -* ]]; then
|
2011-11-20 23:42:20 +03:00
|
|
|
COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
|
2011-10-12 23:01:10 +03:00
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
|
|
|
_pnames
|
|
|
|
} &&
|
|
|
|
complete -F _pgrep pgrep
|
|
|
|
|
|
|
|
# ex: ts=4 sw=4 et filetype=sh
|