about summary refs log tree commit diff
path: root/Completion/Builtins/_enable
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-11-12 15:28:24 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-11-12 15:28:24 +0000
commite6282df1155e8d9b08b2e518a452c1997973f1ce (patch)
treeb0c8ed7e8512cc4397ae7df6d138ea66147565b3 /Completion/Builtins/_enable
parent167b0ae3b98938f75287dcf2e112d41a03532c5f (diff)
downloadzsh-e6282df1155e8d9b08b2e518a452c1997973f1ce.tar.gz
zsh-e6282df1155e8d9b08b2e518a452c1997973f1ce.tar.xz
zsh-e6282df1155e8d9b08b2e518a452c1997973f1ce.zip
manual/8630
Diffstat (limited to 'Completion/Builtins/_enable')
-rw-r--r--Completion/Builtins/_enable29
1 files changed, 11 insertions, 18 deletions
diff --git a/Completion/Builtins/_enable b/Completion/Builtins/_enable
index 7d15e9121..ae2bdc38c 100644
--- a/Completion/Builtins/_enable
+++ b/Completion/Builtins/_enable
@@ -1,22 +1,15 @@
 #compdef enable
 
-local prev="$words[CURRENT-1]" ret=1 expl
+local prev="$words[CURRENT-1]" args
 
-if [[ "$prev" = -*a* ]]; then
-  _description expl alias
-  compadd "$expl[@]" "$@" - "${(k@)dis_aliases}" "${(k@)dis_galiases}" && ret=0
-fi
-if [[ "$prev" = -*f* ]]; then
-  _description expl 'shell function'
-  compadd "$expl[@]" "$@" - "${(k@)dis_functions}" && ret=0
-fi
-if [[ "$prev" = -*r* ]]; then
-  _description expl 'reserved word'
-  compadd "$expl[@]" "$@" - "${(k@)dis_reswords}" && ret=0
-fi
-if [[ "$prev" != -* ]]; then
-  _description expl 'builtin command'
-  compadd "$expl[@]" "$@" - "${(k@)dis_builtins}" && ret=0
-fi
+args=()
+[[ "$prev" = -*a* ]] &&
+    tags=( 'aliases:alias:compadd - ${(@k)dis_aliases} ${(@k)dis_galiases} )
+[[ "$prev" = -*f* ]] &&
+    tags=( "$tags[@]" 'functions:shell function:compadd - ${(@k)dis_functions}' )
+[[ "$prev" = -*r* ]] &&
+    tags=( "$tags[@]" 'reserved-words:reserved word:compadd - ${(@k)dis_reswords}' )
+[[ "$prev" != -* ]]  &&
+    tags=( 'builtins:builtin command:compadd - ${(@k)dis_builtins} )
 
-return ret
+_alternative any "$args[@]"