86ca9ee598
$OSTYPE is automatically available at runtime (for dynamic loading).
45 lines
774 B
Bash
45 lines
774 B
Bash
# pgrep(1) completion.
|
|
|
|
_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
|
|
COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
|
|
return
|
|
fi
|
|
|
|
_pnames
|
|
} &&
|
|
complete -F _pgrep pgrep
|
|
|
|
# Linux pidof(8) completion.
|
|
[[ $OSTYPE == *linux* ]] && complete -F _pgrep pidof
|
|
|
|
# Local variables:
|
|
# mode: shell-script
|
|
# sh-basic-offset: 4
|
|
# sh-indent-comment: t
|
|
# indent-tabs-mode: nil
|
|
# End:
|
|
# ex: ts=4 sw=4 et filetype=sh
|