summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorOliver Kiddle <okiddle@yahoo.co.uk>2018-05-17 22:55:33 +0200
committerOliver Kiddle <okiddle@yahoo.co.uk>2018-05-17 22:55:33 +0200
commitafec5fb1360ea2dff19abe8ac7bfd10ccb4c5926 (patch)
treee88f34459c906fc317389a1e5bb14d0b41afbf73 /Completion
parent1d2f684c9b96cbf9d9e79b8f453c8e52f5c2198e (diff)
downloadzsh-afec5fb1360ea2dff19abe8ac7bfd10ccb4c5926.tar.gz
zsh-afec5fb1360ea2dff19abe8ac7bfd10ccb4c5926.tar.xz
zsh-afec5fb1360ea2dff19abe8ac7bfd10ccb4c5926.zip
42784: complete -s and -x options to the functions builtin
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Zsh/Command/_typeset14
1 files changed, 10 insertions, 4 deletions
diff --git a/Completion/Zsh/Command/_typeset b/Completion/Zsh/Command/_typeset
index 14d5d371b..fb7189c77 100644
--- a/Completion/Zsh/Command/_typeset
+++ b/Completion/Zsh/Command/_typeset
@@ -55,9 +55,13 @@ case ${service} in
   ;;
   float) use="EFHghlprtux";;
   functions)
-    use="UkmTtuzMW"
+    use="UkmTtuzW"
     func=f
-    allargs[M]='(-k -t -T -u -U -z -M +M +k +t +z)-+M[define mathematical function]'
+    args=(
+      '(-k -t -T -u -U -W -x -z -M +M +k +t +W +z)-+M[define mathematical function]'
+      '(-k -m -t -T -u -U -W -x -z +M +k +t +W +z)-s[define mathematical function that takes a string argument]'
+      '(-M)-x+[specify spaces to use for indentation]:spaces'
+    )
   ;;
   integer)
     use="Hghilprtux"
@@ -89,8 +93,10 @@ if [[ "$state" = vars_eq ]]; then
       _wanted functions expl 'math function' compadd -F line - \
           ${${${(f)"$(functions -M)"}##*-M }%% *}
     elif (( $+opt_args[-M] )); then
-      _arguments ':new math function:_functions' ':minimum arguments' \
-      ':maximum arguments' ':shell function:_functions'
+      _arguments ':new math function:_functions' \
+	":minimum arguments${(k)opt_args[-s]:+:(1)}" \
+	":maximum arguments${(k)opt_args[-s]:+:(1)}" \
+	':shell function:_functions'
     elif (( $+opt_args[-w] )); then
       _wanted files expl 'zwc file' _files -g '*.zwc(-.)'
     elif [[ $service = autoload || -n $opt_args[(i)-[uU]] ]]; then