# Bash completion for tpa; loaded automatically by bash-completion.
_tpa() {
    local cur prev words cword command options kind option prefix= i
    _init_completion -n = || return
    command=${words[1]}
    if (( cword == 1 )); then
        COMPREPLY=( $(compgen -W 'help init build check compose parse pack publish inspect capabilities completion verify unlist delete json schema version register login -h --help -version --version' -- "$cur") ); return
    fi
    case "$command" in
        init) options='-name --name -ver --ver -arch --arch -maintainer --maintainer -desc --desc -depends --depends -pre-depends --pre-depends -recommends --recommends -suggests --suggests -provides --provides -conflicts --conflicts -breaks --breaks -replaces --replaces -homepage --homepage -section --section -priority --priority -built-using --built-using -essential --essential -multi-arch --multi-arch -preinst --preinst -postinst --postinst -prerm --prerm -postrm --postrm -out --out -no-provenance --no-provenance -h --help' ;;
        build) options='-in --in -out --out -h --help' ;;
        check) options='-in --in -json --json -h --help' ;;
        compose) options='-in --in -out --out -workers --workers -memory-mib --memory-mib -epoch --epoch -gpg --gpg -origin --origin -label --label -suite --suite -codename --codename -components --components -repo-description --repo-description -h --help' ;;
        parse) options='-in --in -h --help' ;;
        pack) options='-in --in -out --out -output --output -atomic-publish --atomic-publish -empty --empty -architectures --architectures -origin --origin -label --label -suite --suite -codename --codename -components --components -repo-description --repo-description -gpg --gpg -workers --workers -ssh-config --ssh-config -generation-manifest --generation-manifest -repository-id --repository-id -generation-id --generation-id -parent-generation --parent-generation -h --help' ;;
        publish) options='-json --json -in --in -out --out -output --output -ssh-config --ssh-config -keyring --keyring -fingerprint --fingerprint -generation-id --generation-id -parent-generation --parent-generation -h --help' ;;
        inspect) options='-in --in -codename --codename -package --package -ver --ver -arch --arch -json --json -keyring --keyring -fingerprint --fingerprint -require-signed --require-signed -h --help' ;;
        capabilities) options='-h --help' ;;
        completion) options='-h --help' ;;
        verify) options='-in --in -codename --codename -json --json -keyring --keyring -fingerprint --fingerprint -require-signed --require-signed -h --help' ;;
        unlist) options='-in --in -package --package -ver --ver -arch --arch -gpg --gpg -codename --codename -components --components -h --help' ;;
        delete) options='-in --in -package --package -ver --ver -arch --arch -gpg --gpg -codename --codename -components --components -yes --yes -h --help' ;;
        json) options='-no-provenance --no-provenance -h --help' ;;
        schema) options='-h --help' ;;
        version) options='-h --help' ;;
        register) options='-address --address -known-hosts --known-hosts -identity --identity -server --server -confirm --confirm -confirmation-file --confirmation-file -h --help' ;;
        login) options='-address --address -known-hosts --known-hosts -identity --identity -server --server -h --help' ;;
        *) return ;;
    esac
    option=$prev
    if [[ $cur == -*=* ]]; then
        option=${cur%%=*}
        prefix=$option=
        cur=${cur#*=}
    fi
    case "$command:${option#-}" in
        init:name|init:-name) kind=text ;;
        init:ver|init:-ver) kind=text ;;
        init:arch|init:-arch) kind=arch ;;
        init:maintainer|init:-maintainer) kind=text ;;
        init:desc|init:-desc) kind=text ;;
        init:depends|init:-depends) kind=text ;;
        init:pre-depends|init:-pre-depends) kind=text ;;
        init:recommends|init:-recommends) kind=text ;;
        init:suggests|init:-suggests) kind=text ;;
        init:provides|init:-provides) kind=text ;;
        init:conflicts|init:-conflicts) kind=text ;;
        init:breaks|init:-breaks) kind=text ;;
        init:replaces|init:-replaces) kind=text ;;
        init:homepage|init:-homepage) kind=text ;;
        init:section|init:-section) kind=text ;;
        init:priority|init:-priority) kind=text ;;
        init:built-using|init:-built-using) kind=text ;;
        init:essential|init:-essential) kind=yesno ;;
        init:multi-arch|init:-multi-arch) kind=multiarch ;;
        init:preinst|init:-preinst) kind=text ;;
        init:postinst|init:-postinst) kind=text ;;
        init:prerm|init:-prerm) kind=text ;;
        init:postrm|init:-postrm) kind=text ;;
        init:out|init:-out) kind=dir ;;
        init:no-provenance|init:-no-provenance) kind=bool ;;
        init:help|init:-help) kind=bool ;;
        build:in|build:-in) kind=dir ;;
        build:out|build:-out) kind=file ;;
        build:help|build:-help) kind=bool ;;
        check:in|check:-in) kind=dir ;;
        check:json|check:-json) kind=bool ;;
        check:help|check:-help) kind=bool ;;
        compose:in|compose:-in) kind=file ;;
        compose:out|compose:-out) kind=dir ;;
        compose:workers|compose:-workers) kind=text ;;
        compose:memory-mib|compose:-memory-mib) kind=text ;;
        compose:epoch|compose:-epoch) kind=text ;;
        compose:gpg|compose:-gpg) kind=text ;;
        compose:origin|compose:-origin) kind=text ;;
        compose:label|compose:-label) kind=text ;;
        compose:suite|compose:-suite) kind=text ;;
        compose:codename|compose:-codename) kind=text ;;
        compose:components|compose:-components) kind=text ;;
        compose:repo-description|compose:-repo-description) kind=text ;;
        compose:help|compose:-help) kind=bool ;;
        parse:in|parse:-in) kind=file ;;
        parse:help|parse:-help) kind=bool ;;
        pack:in|pack:-in) kind=dir ;;
        pack:out|pack:-out) kind=dir ;;
        pack:output|pack:-output) kind=dir ;;
        pack:atomic-publish|pack:-atomic-publish) kind=dir ;;
        pack:empty|pack:-empty) kind=bool ;;
        pack:architectures|pack:-architectures) kind=text ;;
        pack:origin|pack:-origin) kind=text ;;
        pack:label|pack:-label) kind=text ;;
        pack:suite|pack:-suite) kind=text ;;
        pack:codename|pack:-codename) kind=text ;;
        pack:components|pack:-components) kind=text ;;
        pack:repo-description|pack:-repo-description) kind=text ;;
        pack:gpg|pack:-gpg) kind=text ;;
        pack:workers|pack:-workers) kind=text ;;
        pack:ssh-config|pack:-ssh-config) kind=file ;;
        pack:generation-manifest|pack:-generation-manifest) kind=file ;;
        pack:repository-id|pack:-repository-id) kind=text ;;
        pack:generation-id|pack:-generation-id) kind=text ;;
        pack:parent-generation|pack:-parent-generation) kind=text ;;
        pack:help|pack:-help) kind=bool ;;
        publish:json|publish:-json) kind=none ;;
        publish:in|publish:-in) kind=dir ;;
        publish:out|publish:-out) kind=text ;;
        publish:output|publish:-output) kind=text ;;
        publish:ssh-config|publish:-ssh-config) kind=file ;;
        publish:keyring|publish:-keyring) kind=file ;;
        publish:fingerprint|publish:-fingerprint) kind=text ;;
        publish:generation-id|publish:-generation-id) kind=text ;;
        publish:parent-generation|publish:-parent-generation) kind=text ;;
        publish:help|publish:-help) kind=bool ;;
        inspect:in|inspect:-in) kind=dir ;;
        inspect:codename|inspect:-codename) kind=text ;;
        inspect:package|inspect:-package) kind=text ;;
        inspect:ver|inspect:-ver) kind=text ;;
        inspect:arch|inspect:-arch) kind=arch ;;
        inspect:json|inspect:-json) kind=bool ;;
        inspect:keyring|inspect:-keyring) kind=file ;;
        inspect:fingerprint|inspect:-fingerprint) kind=text ;;
        inspect:require-signed|inspect:-require-signed) kind=bool ;;
        inspect:help|inspect:-help) kind=bool ;;
        capabilities:help|capabilities:-help) kind=bool ;;
        completion:help|completion:-help) kind=bool ;;
        verify:in|verify:-in) kind=dir ;;
        verify:codename|verify:-codename) kind=text ;;
        verify:json|verify:-json) kind=bool ;;
        verify:keyring|verify:-keyring) kind=file ;;
        verify:fingerprint|verify:-fingerprint) kind=text ;;
        verify:require-signed|verify:-require-signed) kind=bool ;;
        verify:help|verify:-help) kind=bool ;;
        unlist:in|unlist:-in) kind=dir ;;
        unlist:package|unlist:-package) kind=text ;;
        unlist:ver|unlist:-ver) kind=text ;;
        unlist:arch|unlist:-arch) kind=arch ;;
        unlist:gpg|unlist:-gpg) kind=text ;;
        unlist:codename|unlist:-codename) kind=text ;;
        unlist:components|unlist:-components) kind=text ;;
        unlist:help|unlist:-help) kind=bool ;;
        delete:in|delete:-in) kind=dir ;;
        delete:package|delete:-package) kind=text ;;
        delete:ver|delete:-ver) kind=text ;;
        delete:arch|delete:-arch) kind=arch ;;
        delete:gpg|delete:-gpg) kind=text ;;
        delete:codename|delete:-codename) kind=text ;;
        delete:components|delete:-components) kind=text ;;
        delete:yes|delete:-yes) kind=bool ;;
        delete:help|delete:-help) kind=bool ;;
        json:no-provenance|json:-no-provenance) kind=bool ;;
        json:help|json:-help) kind=bool ;;
        schema:help|schema:-help) kind=bool ;;
        version:help|version:-help) kind=bool ;;
        register:address|register:-address) kind=text ;;
        register:known-hosts|register:-known-hosts) kind=file ;;
        register:identity|register:-identity) kind=file ;;
        register:server|register:-server) kind=text ;;
        register:confirm|register:-confirm) kind=bool ;;
        register:confirmation-file|register:-confirmation-file) kind=file ;;
        register:help|register:-help) kind=bool ;;
        login:address|login:-address) kind=text ;;
        login:known-hosts|login:-known-hosts) kind=file ;;
        login:identity|login:-identity) kind=file ;;
        login:server|login:-server) kind=text ;;
        login:help|login:-help) kind=bool ;;
    esac
    if [[ $kind == bool && -n $prefix ]]; then
        COMPREPLY=( $(compgen -W 'true false' -- "$cur") )
    elif [[ -n $kind && $kind != bool ]]; then
        case "$kind" in
            dir) _filedir -d ;;
            file) _filedir ;;
            arch) COMPREPLY=( $(compgen -W 'all amd64 arm64 armhf i386 riscv64' -- "$cur") ) ;;
            yesno) COMPREPLY=( $(compgen -W 'yes no' -- "$cur") ) ;;
            multiarch) COMPREPLY=( $(compgen -W 'no same foreign allowed' -- "$cur") ) ;;
            shell) COMPREPLY=( $(compgen -W 'bash zsh fish' -- "$cur") ) ;;
        esac
    elif [[ $cur == -* ]]; then
        COMPREPLY=( $(compgen -W "$options" -- "$cur") )
    else
        case "$command" in
            completion) COMPREPLY=( $(compgen -W 'bash zsh fish' -- "$cur") ) ;;
            pack|inspect|verify|check) _filedir ;;
        esac
    fi
    if [[ -n $prefix ]]; then
        for i in "${!COMPREPLY[@]}"; do COMPREPLY[i]=$prefix${COMPREPLY[i]}; done
    fi
}
complete -F _tpa tpa
