tailscale.plugin.zsh 573 B

123456789101112131415161718
  1. if (( ! $+commands[tailscale] && ! $+aliases[tailscale] )); then
  2. return
  3. fi
  4. # If the completion file doesn't exist yet, we need to autoload it and
  5. # bind it to `tailscale`. Otherwise, compinit will have already done that.
  6. if [[ ! -f "$ZSH_CACHE_DIR/completions/_tailscale" ]]; then
  7. typeset -g -A _comps
  8. autoload -Uz _tailscale
  9. if (( $+commands[tailscale] )); then
  10. _comps[tailscale]=_tailscale
  11. elif (( $+aliases[tailscale] )); then
  12. _comps[${aliases[tailscale]:t}]=_tailscale
  13. fi
  14. fi
  15. tailscale completion zsh >| "$ZSH_CACHE_DIR/completions/_tailscale" &|