mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-27 04:40:59 +01:00
17682: add support for -H and -p in typeset completion
This commit is contained in:
parent
88adedc1d5
commit
770d437504
3 changed files with 48 additions and 35 deletions
|
|
@ -1,3 +1,11 @@
|
||||||
|
2002-09-16 Oliver Kiddle <opk@zsh.org>
|
||||||
|
|
||||||
|
* Completion/Zsh/Command/_typeset, Doc/Zsh/builtins.yo:
|
||||||
|
add support for -H and -p options to completion
|
||||||
|
|
||||||
|
* 17542 (Thomas Stromberg <thomas@stromberg.org>):
|
||||||
|
Completion/Unix/Command/_mount: most systems don't have /etc/mtab
|
||||||
|
|
||||||
2002-09-06 Oliver Kiddle <opk@zsh.org>
|
2002-09-06 Oliver Kiddle <opk@zsh.org>
|
||||||
|
|
||||||
* 17632: Completion/Unix/Command/_cvs: add descriptions for keyword
|
* 17632: Completion/Unix/Command/_cvs: add descriptions for keyword
|
||||||
|
|
|
||||||
|
|
@ -4,42 +4,48 @@ local expl state line func i use curcontext="$curcontext"
|
||||||
local -A allargs
|
local -A allargs
|
||||||
local -a args
|
local -a args
|
||||||
|
|
||||||
allargs=( \
|
allargs=(
|
||||||
A '(-E -F -L -R -T -U -Z -a -f -i -m)-A[specify that arguments refer to associative arrays]' \
|
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]' \
|
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]' \
|
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' \
|
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' \
|
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]' \
|
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]' \
|
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]' \
|
Uf '(-E -F -i)-U[suppress alias expansion for functions]'
|
||||||
Up '(-E -F -i)-U[keep array values unique]' \
|
Up '(-E -F -i)-U[keep array values unique]'
|
||||||
Z '(-A -E -F -f -i)-Z+[right justify and fill with leading zeros]:width' \
|
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]' \
|
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]' \
|
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]' \
|
g '(-T -f)-+g[do not restrict parameter to local scope]'
|
||||||
h '(-T -f)-+h[hide parameter]' \
|
h '(-T -f)-+h[hide specialness of parameter]'
|
||||||
i '(-A -E -F -T -f)-+i[represent internally as an integer]' \
|
H '(-T -f)-+H[hide value of parameter in listings]'
|
||||||
l '(-T -f)-l[convert the value to lowercase]' \
|
i '(-A -E -F -T -f)-+i[represent internally as an integer]'
|
||||||
m '(-A -E -F -T -i)-m[treat arguments as patterns]' \
|
l '(-T -f)-l[convert the value to lowercase]'
|
||||||
r '(-f)-+r[mark parameters as readonly]' \
|
m '(-A -E -F -T -i)-m[treat arguments as patterns]'
|
||||||
t '(-T)-+t[tag parameters and turn on execution tracing for functions]' \
|
p '-p[output parameters in form of calls to typeset]'
|
||||||
tf '(-T)-+t[turn on execution tracing for functions]' \
|
r '(-f)-+r[mark parameters as readonly]'
|
||||||
tp '(-T)-+t[tag parameters]' \
|
t '(-T)-+t[tag parameters and turn on execution tracing for functions]'
|
||||||
u '-u[convert the value to uppercase or mark function for autoloading]' \
|
tf '(-T)-+t[turn on execution tracing for functions]'
|
||||||
uf '-u[mark function for autoloadling]' \
|
tp '(-T)-+t[tag parameters]'
|
||||||
up '-u[convert the value to uppercase]' \
|
u '-u[convert the value to uppercase or mark function for autoloading]'
|
||||||
x '(-f)-+x[export parameter]' )
|
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
|
case ${service} in
|
||||||
float) use="EFghlrtux";;
|
float) use="EFHghlprtux";;
|
||||||
functions)
|
functions)
|
||||||
use="Umtu"
|
use="Umtu"
|
||||||
func=f
|
func=f
|
||||||
;;
|
;;
|
||||||
integer) use="ghilrtux" ;;
|
integer)
|
||||||
|
use="Hghilprtux"
|
||||||
|
allargs[i]='-i[specify arithmetic base for output]' \
|
||||||
|
;;
|
||||||
readonly) use="${use/r/}" ;;
|
readonly) use="${use/r/}" ;;
|
||||||
local) use="${use/f/}" ;&
|
local) use="${use/f/}" ;&
|
||||||
export) use="${${use/g/}/x/}" ;;
|
export) use="${${use/g/}/x/}" ;;
|
||||||
|
|
@ -49,8 +55,7 @@ esac
|
||||||
[[ -z "${words[(r)-*[aA]*]}" ]] || func=p
|
[[ -z "${words[(r)-*[aA]*]}" ]] || func=p
|
||||||
|
|
||||||
for ((i=1;i<=$#use;++i)); do
|
for ((i=1;i<=$#use;++i)); do
|
||||||
args=( "${args[@]}" \
|
args+=( ${allargs[${use[$i]}${${(s::)use[$i]}[(r)[Uut]]:+$func}]} )
|
||||||
${allargs[${use[$i]}${${(s::)use[$i]}[(r)[Uut]]:+$func}]} )
|
|
||||||
done
|
done
|
||||||
|
|
||||||
_arguments -C -s -A "-*" -S "${args[@]}" '*:vars:->vars_eq'
|
_arguments -C -s -A "-*" -S "${args[@]}" '*:vars:->vars_eq'
|
||||||
|
|
|
||||||
|
|
@ -424,7 +424,7 @@ Bring each specified var(job) in turn to the foreground.
|
||||||
If no var(job) is specified, resume the current job.
|
If no var(job) is specified, resume the current job.
|
||||||
)
|
)
|
||||||
findex(float)
|
findex(float)
|
||||||
item(tt(float) [ {tt(PLUS())|tt(-)}tt(EFghlprtux) ] [ var(name)[tt(=)var(value)] ... ])(
|
item(tt(float) [ {tt(PLUS())|tt(-)}tt(EFHghlprtux) ] [ var(name)[tt(=)var(value)] ... ])(
|
||||||
Equivalent to tt(typeset -E), except that options irrelevant to floating
|
Equivalent to tt(typeset -E), except that options irrelevant to floating
|
||||||
point numbers are not permitted.
|
point numbers are not permitted.
|
||||||
)
|
)
|
||||||
|
|
@ -526,7 +526,7 @@ the form of a call to hash.
|
||||||
)
|
)
|
||||||
alias(history)(fc -l)
|
alias(history)(fc -l)
|
||||||
findex(integer)
|
findex(integer)
|
||||||
item(tt(integer) [ {tt(PLUS())|tt(-)}tt(ghilprtux) ] [ var(name)[tt(=)var(value)] ... ])(
|
item(tt(integer) [ {tt(PLUS())|tt(-)}tt(Hghilprtux) ] [ var(name)[tt(=)var(value)] ... ])(
|
||||||
Equivalent to tt(typeset -i), except that options irrelevant to
|
Equivalent to tt(typeset -i), except that options irrelevant to
|
||||||
integers are not permitted.
|
integers are not permitted.
|
||||||
)
|
)
|
||||||
|
|
@ -625,7 +625,7 @@ sitem([var(mm)tt(:)]var(ss))(minutes and seconds)
|
||||||
endsitem()
|
endsitem()
|
||||||
)
|
)
|
||||||
findex(local)
|
findex(local)
|
||||||
item(tt(local) [ {tt(PLUS())|tt(-)}tt(AEFLRUZahilprtux) [var(n)]] [ var(name)[tt(=)var(value)] ] ...)(
|
item(tt(local) [ {tt(PLUS())|tt(-)}tt(AEFHLRUZahilprtux) [var(n)]] [ var(name)[tt(=)var(value)] ] ...)(
|
||||||
Same as tt(typeset), except that the options tt(-g), and
|
Same as tt(typeset), except that the options tt(-g), and
|
||||||
tt(-f) are not permitted. In this case the tt(-x) option does not force
|
tt(-f) are not permitted. In this case the tt(-x) option does not force
|
||||||
the use of tt(-g), i.e. exported variables will be local to functions.
|
the use of tt(-g), i.e. exported variables will be local to functions.
|
||||||
|
|
@ -1080,7 +1080,7 @@ Equivalent to tt(whence -v).
|
||||||
findex(typeset)
|
findex(typeset)
|
||||||
cindex(parameters, setting)
|
cindex(parameters, setting)
|
||||||
cindex(parameters, declaring)
|
cindex(parameters, declaring)
|
||||||
xitem(tt(typeset) [ {tt(PLUS())|tt(-)}tt(AEFLRUZafghilprtuxm) [var(n)]] [ \
|
xitem(tt(typeset) [ {tt(PLUS())|tt(-)}tt(AEFHLRUZafghilprtuxm) [var(n)]] [ \
|
||||||
var(name)[tt(=)var(value)] ... ])
|
var(name)[tt(=)var(value)] ... ])
|
||||||
item(tt(typeset) -T [ {tt(PLUS()|tt(-))}tt(LRUZrux) ] \
|
item(tt(typeset) -T [ {tt(PLUS()|tt(-))}tt(LRUZrux) ] \
|
||||||
var(SCALAR)[tt(=)var(value)] var(array))(
|
var(SCALAR)[tt(=)var(value)] var(array))(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue