# Linux and FreeBSD pgrep(1) completion.


comp_include _get_cword


[ $UNAME = Linux -o $UNAME = FreeBSD ] &&
_pgrep()
{
    local cur

    COMPREPLY=()
    cur=`_get_cword`

    COMPREPLY=( $( compgen -W '$( command ps axo command | \
              sed -ne "1d; s/^\[\?\([^-][^] ]*\).*$/\1/p" | \
              sed -e "s/.*\///" )' -- $cur ) )

    return 0
} # _pgrep()
