diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2001-03-05 13:18:59 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2001-03-05 13:18:59 +0000 |
commit | 3e6563dd039f84990060674890c9ce9b32fd68ce (patch) | |
tree | d8ad4f2cc3743764bd59e5601ba28ea4527c0c45 /Completion/Builtins | |
parent | eb41692bc56f22c7587426c4e5fa3c75ea0dfeab (diff) | |
download | zsh-3e6563dd039f84990060674890c9ce9b32fd68ce.tar.gz zsh-3e6563dd039f84990060674890c9ce9b32fd68ce.tar.xz zsh-3e6563dd039f84990060674890c9ce9b32fd68ce.zip |
new _expand_aliases to, well, expand aliases (13566)
Diffstat (limited to 'Completion/Builtins')
-rw-r--r-- | Completion/Builtins/_aliases | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Completion/Builtins/_aliases b/Completion/Builtins/_aliases index 07e5dc5cb..db8e31678 100644 --- a/Completion/Builtins/_aliases +++ b/Completion/Builtins/_aliases @@ -1,7 +1,17 @@ #compdef alias unalias -local expl +local expl sel args opts -_alternative \ - 'aliases:regular alias:compadd -k aliases' \ - 'global-aliases:global alias:compadd -k galiases' +zparseopts -E -D s:=sel + +[[ -z $sel ]] && sel=rg + +opts=( "$@" ) + +args=() +[[ $sel = *r* ]] && args=( $args 'aliases:regular alias:compadd -k aliases' ) +[[ $sel = *g* ]] && args=( $args 'global-aliases:global alias:compadd -k galiases' ) +[[ $sel = *R* ]] && args=( $args 'disabled-aliases:disabled regular alias:compadd -k dis_aliases' ) +[[ $sel = *G* ]] && args=( $args 'disabled-global-aliases:disabled global alias:compadd -k dis_galiases' ) + +_alternative -O opts $args |