have llx-gva-gate &&
_llx-gva-gate()
{
    local cur prev opts base
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"

    #
    #  The basic options we'll complete.
    #
    opts="create groups users auth cache dump"

    case "${prev}" in

        cache)
            local flags="list purge"
            COMPREPLY=( $(compgen -W "${flags}" -- ${cur}) )
            return 0
            ;;
        dump)
            local flags="users shadow"
            COMPREPLY=( $(compgen -W "${flags}" -- ${cur}) )
            return 0
            ;;
        *)
            COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
            return 0
            ;;

    esac
}
[ "$have" ] && complete -F _llx-gva-gate llx-gva-gate
