1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-03 10:21:46 +02:00

25029: : "environ" style to allow a different search path when completing

as a different user.
This commit is contained in:
Bart Schaefer 2008-10-10 09:56:25 +00:00
parent f1628c3278
commit 7783d398c3
2 changed files with 15 additions and 0 deletions

View file

@ -1,5 +1,12 @@
#compdef sudo
local curcontext="$curcontext" environ e
zstyle -a "$curcontext" environ environ
for e in "${environ[@]}"
do local -x "$e"
done
_arguments \
'-V[show version]' \
'-l[list allowed commands]' \

View file

@ -1312,6 +1312,14 @@ A list of names of network domains for completion.
If this is not set, domain names will be taken from
the file tt(/etc/resolv.conf).
)
kindex(environ, completion style)
item(tt(environ))(
The environ style is used when completing for `tt(sudo)'. It is set to an
array of `var(VAR)tt(=)var(value)' assignments to be exported into the
local environment before the completion for the target command is invoked.
example(zstyle :complete:sudo: environ \
PATH="/sbin:/usr/sbin:$PATH" HOME="/root")
)
kindex(expand, completion style)
item(tt(expand))(
This style is used when completing strings consisting of multiple