_complate() { local i cur prev opts cmd COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" cmd="" opts="" for i in ${COMP_WORDS[@]} do case "${cmd},${i}" in ",$1") cmd="complate" ;; complate,autocomplete) cmd="complate__autocomplete" ;; complate,help) cmd="complate__help" ;; complate,init) cmd="complate__init" ;; complate,man) cmd="complate__man" ;; complate,render) cmd="complate__render" ;; complate,schema) cmd="complate__schema" ;; complate__help,autocomplete) cmd="complate__help__autocomplete" ;; complate__help,help) cmd="complate__help__help" ;; complate__help,init) cmd="complate__help__init" ;; complate__help,man) cmd="complate__help__man" ;; complate__help,render) cmd="complate__help__render" ;; complate__help,schema) cmd="complate__help__schema" ;; *) ;; esac done case "${cmd}" in complate) opts="-e -h -V --experimental --help --version man autocomplete init schema render help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in *) COMPREPLY=() ;; esac COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; complate__autocomplete) opts="-o -s -h -V --out --shell --help --version" if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in --out) COMPREPLY=($(compgen -f "${cur}")) return 0 ;; -o) COMPREPLY=($(compgen -f "${cur}")) return 0 ;; --shell) COMPREPLY=($(compgen -W "bash zsh fish elvish powershell" -- "${cur}")) return 0 ;; -s) COMPREPLY=($(compgen -W "bash zsh fish elvish powershell" -- "${cur}")) return 0 ;; *) COMPREPLY=() ;; esac COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; complate__help) opts="man autocomplete init schema render help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in *) COMPREPLY=() ;; esac COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; complate__help__autocomplete) opts="" if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in *) COMPREPLY=() ;; esac COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; complate__help__help) opts="" if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in *) COMPREPLY=() ;; esac COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; complate__help__init) opts="" if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in *) COMPREPLY=() ;; esac COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; complate__help__man) opts="" if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in *) COMPREPLY=() ;; esac COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; complate__help__render) opts="" if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in *) COMPREPLY=() ;; esac COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; complate__help__schema) opts="" if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in *) COMPREPLY=() ;; esac COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; complate__init) opts="-h -V --help --version" if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in *) COMPREPLY=() ;; esac COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; complate__man) opts="-o -f -h -V --out --format --help --version" if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in --out) COMPREPLY=($(compgen -f "${cur}")) return 0 ;; -o) COMPREPLY=($(compgen -f "${cur}")) return 0 ;; --format) COMPREPLY=($(compgen -W "manpages markdown" -- "${cur}")) return 0 ;; -f) COMPREPLY=($(compgen -W "manpages markdown" -- "${cur}")) return 0 ;; *) COMPREPLY=() ;; esac COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; complate__render) opts="-c -t -l -b -v -h -V --config --template --trust --loose --backend --value --help --version" if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in --config) COMPREPLY=($(compgen -f "${cur}")) return 0 ;; -c) COMPREPLY=($(compgen -f "${cur}")) return 0 ;; --template) COMPREPLY=($(compgen -f "${cur}")) return 0 ;; -t) COMPREPLY=($(compgen -f "${cur}")) return 0 ;; --backend) COMPREPLY=($(compgen -W "headless cli" -- "${cur}")) return 0 ;; -b) COMPREPLY=($(compgen -W "headless cli" -- "${cur}")) return 0 ;; --value) COMPREPLY=($(compgen -f "${cur}")) return 0 ;; -v) COMPREPLY=($(compgen -f "${cur}")) return 0 ;; *) COMPREPLY=() ;; esac COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; complate__schema) opts="-h -V --help --version" if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in *) COMPREPLY=() ;; esac COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; esac } complete -F _complate -o bashdefault -o default complate