mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-30 02:44:42 +01:00
fix(tailscale): completion when tailscale is alias
This commit is contained in:
parent
62cf1201b0
commit
7a90b50f7c
1 changed files with 5 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
if (( ! $+commands[tailscale] )); then
|
if (( ! ($+commands[tailscale] || $+aliases[tailscale]) )); then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -8,6 +8,10 @@ if [[ ! -f "$ZSH_CACHE_DIR/completions/_tailscale" ]]; then
|
||||||
typeset -g -A _comps
|
typeset -g -A _comps
|
||||||
autoload -Uz _tailscale
|
autoload -Uz _tailscale
|
||||||
_comps[tailscale]=_tailscale
|
_comps[tailscale]=_tailscale
|
||||||
|
if (( $+aliases[tailscale] )); then
|
||||||
|
# `basename "$(alias tailscale | sed "s/.*=\(.*\)/\1/")"` should output executable name
|
||||||
|
compdef "$(basename "$(alias tailscale | sed "s/.*=\(.*\)/\1/")")"="tailscale"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tailscale completion zsh >| "$ZSH_CACHE_DIR/completions/_tailscale" &|
|
tailscale completion zsh >| "$ZSH_CACHE_DIR/completions/_tailscale" &|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue