gh.plugin.zsh 364 B

12345678910111213
  1. # Autocompletion for the GitHub CLI (gh).
  2. if (( $+commands[gh] )); then
  3. if [[ ! -r "$ZSH_CACHE_DIR/gh_version" \
  4. || "$(gh --version)" != "$(< "$ZSH_CACHE_DIR/gh_version")"
  5. || ! -f "$ZSH/plugins/gh/_gh" ]]; then
  6. gh completion --shell zsh > $ZSH/plugins/gh/_gh
  7. gh --version > $ZSH_CACHE_DIR/gh_version
  8. fi
  9. autoload -Uz _gh
  10. _comps[gh]=_gh
  11. fi