_cargo-liner() { 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="cargo__liner" ;; cargo__liner,completions) cmd="cargo__liner__completions" ;; cargo__liner,help) cmd="cargo__liner__help" ;; cargo__liner,import) cmd="cargo__liner__import" ;; cargo__liner,ship) cmd="cargo__liner__ship" ;; cargo__liner__help,completions) cmd="cargo__liner__help__completions" ;; cargo__liner__help,help) cmd="cargo__liner__help__help" ;; cargo__liner__help,import) cmd="cargo__liner__help__import" ;; cargo__liner__help,ship) cmd="cargo__liner__help__ship" ;; *) ;; esac done case "${cmd}" in cargo__liner) opts="-v -q -h -V --verbose --quiet --color --help --version ship import completions help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in --color) COMPREPLY=($(compgen -W "auto always never" -- "${cur}")) return 0 ;; *) COMPREPLY=() ;; esac COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; cargo__liner__completions) opts="-v -q -h --verbose --quiet --color --help bash elvish fish powershell zsh" if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in --color) COMPREPLY=($(compgen -W "auto always never" -- "${cur}")) return 0 ;; *) COMPREPLY=() ;; esac COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; cargo__liner__help) opts="ship import completions 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 ;; cargo__liner__help__completions) 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 ;; cargo__liner__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 ;; cargo__liner__help__import) 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 ;; cargo__liner__help__ship) 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 ;; cargo__liner__import) opts="-e -c -p -f -s -l -v -q -h --exact --compatible --patch --force --keep-self --keep-local --verbose --quiet --color --help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in --color) COMPREPLY=($(compgen -W "auto always never" -- "${cur}")) return 0 ;; *) COMPREPLY=() ;; esac COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; cargo__liner__ship) opts="-n -s -c -k -f -v -q -h --no-self --only-self --skip-check --no-fail-fast --force --with-self --no-only-self --no-skip-check --fail-fast --no-force --verbose --quiet --color --help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in --color) COMPREPLY=($(compgen -W "auto always never" -- "${cur}")) return 0 ;; *) COMPREPLY=() ;; esac COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; esac } if [[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 || "${BASH_VERSINFO[0]}" -gt 4 ]]; then complete -F _cargo-liner -o nosort -o bashdefault -o default cargo-liner else complete -F _cargo-liner -o bashdefault -o default cargo-liner fi