summary refs log tree commit diff
path: root/Completion/Zsh/Command
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2002-09-16 18:10:49 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2002-09-16 18:10:49 +0000
commit770d437504dccda11a883da28d35adc09862f17d (patch)
tree66eb5e0b387e919a85118f9bd71bfc188324f8e7 /Completion/Zsh/Command
parent88adedc1d57d62b2203ada133b5507437227c594 (diff)
downloadzsh-770d437504dccda11a883da28d35adc09862f17d.tar.gz
zsh-770d437504dccda11a883da28d35adc09862f17d.tar.xz
zsh-770d437504dccda11a883da28d35adc09862f17d.zip
17682: add support for -H and -p in typeset completion
Diffstat (limited to 'Completion/Zsh/Command')
-rw-r--r--Completion/Zsh/Command/_typeset67
1 files changed, 36 insertions, 31 deletions
diff --git a/Completion/Zsh/Command/_typeset b/Completion/Zsh/Command/_typeset
index c49066a2c..93e773ace 100644
--- a/Completion/Zsh/Command/_typeset
+++ b/Completion/Zsh/Command/_typeset
@@ -4,42 +4,48 @@ local expl state line func i use curcontext="$curcontext"
 local -A allargs
 local -a args
 
-allargs=( \
-  A '(-E -F -L -R -T -U -Z -a -f -i -m)-A[specify that arguments refer to associative arrays]' \
-  E '(-A -F -L -R -T -U -Z -a -f -i -m)-E[floating point, use engineering notation on output]' \
-  F '(-A -E -L -R -T -U -Z -a -f -i -m)-F[floating point, use fixed point decimal on output]' \
-  L '(-A -E -F -f -i)-L+[left justify and remove leading blanks from value]:width' \
-  R '(-A -E -F -f -i)-R+[right justify and fill with leading blanks]:width' \
-  T '(-A -E -F -a -f -g -h -i -l -m -t)-T[tie scalar to array]' \
-  U '(-A -E -F -i)-U[keep array values unique and suppress alias expansion for functions]' \
-  Uf '(-E -F -i)-U[suppress alias expansion for functions]' \
-  Up '(-E -F -i)-U[keep array values unique]' \
-  Z '(-A -E -F -f -i)-Z+[right justify and fill with leading zeros]:width' \
-  a '(-A -E -F -T -f -i)-a[specify that arguments refer to arrays]' \
-  f '(-A -E -F -L -R -T -Z -a -g -h -i -l -r -x)-f[specify that arguments refer to functions]' \
-  g '(-T -f)-+g[do not restrict parameter to local scope]' \
-  h '(-T -f)-+h[hide parameter]' \
-  i '(-A -E -F -T -f)-+i[represent internally as an integer]' \
-  l '(-T -f)-l[convert the value to lowercase]' \
-  m '(-A -E -F -T -i)-m[treat arguments as patterns]' \
-  r '(-f)-+r[mark parameters as readonly]' \
-  t '(-T)-+t[tag parameters and turn on execution tracing for functions]' \
-  tf '(-T)-+t[turn on execution tracing for functions]' \
-  tp '(-T)-+t[tag parameters]' \
-  u '-u[convert the value to uppercase or mark function for autoloading]' \
-  uf '-u[mark function for autoloadling]' \
-  up '-u[convert the value to uppercase]' \
-  x '(-f)-+x[export parameter]' )
+allargs=(
+  A '(-E -F -L -R -T -U -Z -a -f -i -m)-A[specify that arguments refer to associative arrays]'
+  E '(-A -F -L -R -T -U -Z -a -f -i -m)-E[floating point, use engineering notation on output]'
+  F '(-A -E -L -R -T -U -Z -a -f -i -m)-F[floating point, use fixed point decimal on output]'
+  L '(-A -E -F -f -i)-L+[left justify and remove leading blanks from value]:width'
+  R '(-A -E -F -f -i)-R+[right justify and fill with leading blanks]:width'
+  T '(-A -E -F -a -f -g -h -i -l -m -t)-T[tie scalar to array]'
+  U '(-A -E -F -i)-U[keep array values unique and suppress alias expansion for functions]'
+  Uf '(-E -F -i)-U[suppress alias expansion for functions]'
+  Up '(-E -F -i)-U[keep array values unique]'
+  Z '(-A -E -F -f -i)-Z+[right justify and fill with leading zeros]:width'
+  a '(-A -E -F -T -f -i)-a[specify that arguments refer to arrays]'
+  f '(-A -E -F -L -R -T -Z -a -g -h -i -l -r -x)-f[specify that arguments refer to functions]'
+  g '(-T -f)-+g[do not restrict parameter to local scope]'
+  h '(-T -f)-+h[hide specialness of parameter]'
+  H '(-T -f)-+H[hide value of parameter in listings]'
+  i '(-A -E -F -T -f)-+i[represent internally as an integer]'
+  l '(-T -f)-l[convert the value to lowercase]'
+  m '(-A -E -F -T -i)-m[treat arguments as patterns]'
+  p '-p[output parameters in form of calls to typeset]'
+  r '(-f)-+r[mark parameters as readonly]'
+  t '(-T)-+t[tag parameters and turn on execution tracing for functions]'
+  tf '(-T)-+t[turn on execution tracing for functions]'
+  tp '(-T)-+t[tag parameters]'
+  u '-u[convert the value to uppercase or mark function for autoloading]'
+  uf '-u[mark function for autoloadling]'
+  up '-u[convert the value to uppercase]'
+  x '(-f)-+x[export parameter]'
+)
 
-use="AEFLRTUZafghilmrtux"
+use="AEFHLRTUZafghilmprtux"
 
 case ${service} in
-  float) use="EFghlrtux";;
+  float) use="EFHghlprtux";;
   functions)
     use="Umtu"
     func=f
   ;;
-  integer) use="ghilrtux" ;;
+  integer)
+    use="Hghilprtux"
+    allargs[i]='-i[specify arithmetic base for output]' \
+  ;;
   readonly) use="${use/r/}" ;;
   local) use="${use/f/}" ;&
   export) use="${${use/g/}/x/}" ;;
@@ -49,8 +55,7 @@ esac
 [[ -z "${words[(r)-*[aA]*]}" ]] || func=p
    
 for ((i=1;i<=$#use;++i)); do
-  args=( "${args[@]}" \
-      ${allargs[${use[$i]}${${(s::)use[$i]}[(r)[Uut]]:+$func}]} )
+  args+=( ${allargs[${use[$i]}${${(s::)use[$i]}[(r)[Uut]]:+$func}]} )
 done
 
 _arguments -C -s -A "-*" -S "${args[@]}" '*:vars:->vars_eq'