summaryrefslogtreecommitdiff
path: root/Completion/Zsh/Command/_alias
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Zsh/Command/_alias')
-rw-r--r--Completion/Zsh/Command/_alias13
1 files changed, 8 insertions, 5 deletions
diff --git a/Completion/Zsh/Command/_alias b/Completion/Zsh/Command/_alias
index 8feb14a07..8b28f470a 100644
--- a/Completion/Zsh/Command/_alias
+++ b/Completion/Zsh/Command/_alias
@@ -1,11 +1,12 @@
#compdef alias
-local curcontext="$curcontext" state line suf
+local curcontext="$curcontext" state line type suf
+typeset -A opt_args
_arguments -C -s -A "-*" -S \
- '-+g[list or define global aliases]' \
- '-+r[list or define regular aliases]' \
- '-+s[list or define suffix aliases]' \
+ '(-r +r -s +s)-+g[list or define global aliases]' \
+ '(-g +g -s +s)-+r[list or define regular aliases]' \
+ '(-r +r -g +g)-+s[list or define suffix aliases]' \
'-+m[print aliases matching specified pattern]' \
'-L[print each alias in the form of calls to alias]' \
'*::alias definition:->defn'
@@ -16,6 +17,8 @@ if [[ -n "$state" ]]; then
_normal
else
compset -S '=*' || suf='='
- _wanted alias expl 'alias definition' _aliases -S "$suf"
+ type=( ${opt_args[(i)[-+][grs]]#?} )
+ (( $#type )) && type=( -s $type )
+ _wanted -x alias expl 'alias definition' _aliases -S "$suf" "$type[@]"
fi
fi