#
# OpenBSD stuff
#

# GNU ls(1) from OpenBSD ports is named gls(1)/gdircolors(1).
if -exe gls; then
    if [ "$TERM" != 'dumb' ]; then
        if -exe gdircolors; then
            if [ -r ~/.dircolors ]; then
                eval $(gdircolors -b ~/.dircolors)
            else
                eval $(gdircolors -b)
            fi
        fi
        alias ls='gls -h --color=auto'
        alias l='gls -lh --color=auto'
    else
        alias ls='gls -h'
        alias l='gls -lh'
    fi

# colorls(1) is {Open,Net}BSD port name for FreeBSD ls(1)
elif -exe colorls; then
    if [ "$TERM" != 'dumb' ]; then
        export LSCOLORS='exfxbxdxcxegedabagacad'
        alias ls='colorls -GFh'
        alias l='colorls -lGFh'
    else
        alias ls='colorls -Fh'
        alias l='colorls -lFh'
    fi
else
    alias ls='ls -Fh'
fi

# GNU tar is called gtar
if -exe gtar; then
    alias tar='gtar'
fi

# GNU find is called gfind
if -exe gfind; then
    alias find='gfind'
fi

