about summary refs log tree commit diff
path: root/Completion/Builtins/_aliases
blob: db8e3167888fc74b4ed73e2d54a2baa5248cad1d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#compdef alias unalias

local expl sel args opts

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