...

Text file src/github.com/urfave/cli/v2/autocomplete/zsh_autocomplete

Documentation: github.com/urfave/cli/v2/autocomplete

     1#compdef $PROG
     2
     3_cli_zsh_autocomplete() {
     4  local -a opts
     5  local cur
     6  cur=${words[-1]}
     7  if [[ "$cur" == "-"* ]]; then
     8    opts=("${(@f)$(${words[@]:0:#words[@]-1} ${cur} --generate-bash-completion)}")
     9  else
    10    opts=("${(@f)$(${words[@]:0:#words[@]-1} --generate-bash-completion)}")
    11  fi
    12
    13  if [[ "${opts[1]}" != "" ]]; then
    14    _describe 'values' opts
    15  else
    16    _files
    17  fi
    18}
    19
    20compdef _cli_zsh_autocomplete $PROG

View as plain text