#compdef hostit-proxy
# zsh completion for hostit-proxy, answered by the CLI itself: the binary prints the
# candidates for the current word when called with --generate-bash-completion.
_hostit_proxy_completion() {
  local -a opts
  local cur
  cur=${words[-1]}
  if [[ "$cur" == -* ]]; then
    opts=("${(@f)$(${words[@]:0:#words[@]-1} ${cur} --generate-bash-completion 2>/dev/null)}")
  else
    opts=("${(@f)$(${words[@]:0:#words[@]-1} --generate-bash-completion 2>/dev/null)}")
  fi
  if [[ "${opts[1]}" != "" ]]; then
    _describe 'values' opts
  else
    _files
  fi
}
compdef _hostit_proxy_completion hostit-proxy
