summary refs log tree commit diff
path: root/Completion/Zsh/Command
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2013-10-09 19:02:13 +0200
committerMikael Magnusson <mikachu@gmail.com>2013-10-11 14:57:57 +0200
commit38adc173369ae5b4cf4c3175494edd9743724640 (patch)
treebfaf9d2fa87f89afded0d682d2fd8203db3e99c5 /Completion/Zsh/Command
parent6f921b91f475f77c1447fed4cada24235958b13d (diff)
downloadzsh-38adc173369ae5b4cf4c3175494edd9743724640.tar.gz
zsh-38adc173369ae5b4cf4c3175494edd9743724640.tar.xz
zsh-38adc173369ae5b4cf4c3175494edd9743724640.zip
31806: _enable _disable: Workaround special characters in alias and function names breaking _arguments syntax
Diffstat (limited to 'Completion/Zsh/Command')
-rw-r--r--Completion/Zsh/Command/_disable12
-rw-r--r--Completion/Zsh/Command/_enable12
2 files changed, 18 insertions, 6 deletions
diff --git a/Completion/Zsh/Command/_disable b/Completion/Zsh/Command/_disable
index 68be75fd4..52b82a6e9 100644
--- a/Completion/Zsh/Command/_disable
+++ b/Completion/Zsh/Command/_disable
@@ -1,10 +1,16 @@
 #compdef disable
 
+local -a ali_arr sali_arr func_arr
+
+ali_arr=(${(k)aliases} ${(k)galiases})
+sali_arr=(${(k)saliases})
+func_arr=(${(k)functions})
+
 _arguments -C -s -A "-*" -S \
-  "(-f -r -s -p)-a[act on regular or global aliases]:*:regular or global aliases:(${(k)aliases} ${(k)galiases})" \
-  "(-a -r -s -p)-f[act on functions]:*:functions:(${(k)functions})" \
+  "(-f -r -s -p)-a[act on regular or global aliases]:*:regular or global aliases:compadd -k ali_arr" \
+  "(-a -r -s -p)-f[act on functions]:*:functions:compadd -k func_arr" \
   "(-a -f -s -p)-r[act on reserved words]:*:reserved-words:compadd -k reswords" \
-  "(-a -f -r -p)-s[act on suffix aliases]:*:suffix aliases:(${(k)saliases})" \
+  "(-a -f -r -p)-s[act on suffix aliases]:*:suffix aliases:compadd -k sali_arr" \
   "(-a -f -r -s)-p[act on pattern characters]:*:pattern characters:compadd -k patchars" \
   '-m[treat arguments as patterns]' \
   "*:builtin command:(${(k)builtins})"
diff --git a/Completion/Zsh/Command/_enable b/Completion/Zsh/Command/_enable
index f7737823f..9410651b7 100644
--- a/Completion/Zsh/Command/_enable
+++ b/Completion/Zsh/Command/_enable
@@ -1,10 +1,16 @@
 #compdef enable
 
+local -a ali_arr sali_arr func_arr
+
+ali_arr=(${(k)dis_aliases} ${(k)dis_galiases})
+sali_arr=(${(k)dis_saliases})
+func_arr=(${(k)dis_functions})
+
 _arguments -C -s -A "-*" -S \
-  "(-f -r -s -p)-a[act on regular or global aliases]:*:aliases:(${(k)dis_aliases} ${(k)dis_galiases})" \
-  "(-a -r -s -p)-f[act on functions]:*:functions:(${(k)dis_functions})" \
+  "(-f -r -s -p)-a[act on regular or global aliases]:*:aliases:compadd -k ali_arr" \
+  "(-a -r -s -p)-f[act on functions]:*:functions:compadd -k func_arr" \
   "(-a -f -s -p)-r[act on reserved words]:*:reserved-words:compadd -k dis_reswords" \
-  "(-a -f -r -p)-s[act on suffix aliases]:*:suffix aliases:(${(k)dis_saliases})" \
+  "(-a -f -r -p)-s[act on suffix aliases]:*:suffix aliases:compadd -k sali_arr" \
   "(-a -f -r -s)-p[act on pattern characters]:*:pattern characters:compadd -k dis_patchars" \
   '-m[treat arguments as patterns]' \
   "*:builtin command:(${(k)dis_builtins})"