poetry.plugin.zsh 434 B

1234567891011121314
  1. # Return immediately if poetry is not found
  2. if (( ! $+commands[poetry] )); then
  3. return
  4. fi
  5. # If the completion file doesn't exist yet, we need to autoload it and
  6. # bind it to `poetry`. Otherwise, compinit will have already done that.
  7. if [[ ! -f "$ZSH_CACHE_DIR/completions/_poetry" ]]; then
  8. typeset -g -A _comps
  9. autoload -Uz _poetry
  10. _comps[poetry]=_poetry
  11. fi
  12. poetry completions zsh >| "$ZSH_CACHE_DIR/completions/_poetry" &|