Ville Skyttä 86ca9ee598 Replace $UNAME with $OSTYPE in trivial cases.
$OSTYPE is automatically available at runtime (for dynamic loading).
2011-10-12 23:07:21 +03:00

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