_emsource() 
{
    local cur prev opts
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"
    # the basic options to complete
    opts="--arch --username --help --verbose --version --quiet -a -u -h -v -q"

    if [[ ${cur} == -* ]] ; then
        COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
        return 0
    fi
}
complete -F _emsource emsource

_emchain()
{
	local cur prev opts
	COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"
	opts="-a --arch -w --workdir -l --log -v --verbose -q --quiet -h --help --version"
    if [[ ${cur} == -* ]] ; then
        COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
        return 0
    fi
}
complete -F _emchain emchain

_emdebuild()
{
	local cur prev opts
	COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"
	opts="-a --arch -n --next --svn --sign -v --verbose -q --quiet --svn-only -v --verbose"
	opts="$opts -q --quiet -h --help --version"
    if [[ ${cur} == -* ]] ; then
        COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
        return 0
    fi
}
complete -F _emdebuild emdebuild

_emlocale()
{
	local cur prev opts
	COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"
	opts="-v --verbose -q --quiet -k --keep -c --clean"
    if [[ ${cur} == -* ]] ; then
        COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
        return 0
    fi
}
complete -F _emlocale emlocale

_em_make()
{
	local cur prev opts
	COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"
	opts="-a --arch --forceold -v --verbose -q --quiet -h --help --version"
    if [[ ${cur} == -* ]] ; then
        COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
        return 0
    fi
}
complete -F _em_make em_make
