mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-30 02:44:42 +01:00
Optimize and use idiomatic zsh
This commit is contained in:
parent
7a90b50f7c
commit
af41403a5b
1 changed files with 6 additions and 5 deletions
|
|
@ -1,4 +1,4 @@
|
|||
if (( ! ($+commands[tailscale] || $+aliases[tailscale]) )); then
|
||||
if (( ! $+commands[tailscale] && ! $+aliases[tailscale] )); then
|
||||
return
|
||||
fi
|
||||
|
||||
|
|
@ -7,10 +7,11 @@ fi
|
|||
if [[ ! -f "$ZSH_CACHE_DIR/completions/_tailscale" ]]; then
|
||||
typeset -g -A _comps
|
||||
autoload -Uz _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"
|
||||
|
||||
if (( $+commands[tailscale] )); then
|
||||
_comps[tailscale]=_tailscale
|
||||
elif (( $+aliases[tailscale] )); then
|
||||
_comps[${aliases[tailscale]:t}]=_tailscale
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue