* PATCH: environ style
@ 2012-02-10 15:58 Oliver Kiddle
0 siblings, 0 replies; only message in thread
From: Oliver Kiddle @ 2012-02-10 15:58 UTC (permalink / raw)
To: Zsh workers
The environ style in _sudo is being looked up without the conventional
:completion: prefix. So unfortunately this fix is going to break the
style for anyone that uses it. Is anyone especially upset by that?
I'd also be tempted to put the command in the context if the command is
already on the command-line much as we do for git/svn etc subcommands.
Oliver
diff --git a/Completion/Unix/Command/_sudo b/Completion/Unix/Command/_sudo
index 384e935..f8543f8 100644
--- a/Completion/Unix/Command/_sudo
+++ b/Completion/Unix/Command/_sudo
@@ -3,7 +3,7 @@
local curcontext="$curcontext" environ e
local -a args
-zstyle -a "$curcontext" environ environ
+zstyle -a ":completion:${curcontext}:" environ environ
for e in "${environ[@]}"
do local -x "$e"
diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index 665c0d4..135a60a 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -1333,7 +1333,7 @@ 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 \
+example(zstyle ':completion:*:sudo::' environ \
PATH="/sbin:/usr/sbin:$PATH" HOME="/root")
)
kindex(expand, completion style)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-02-10 16:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-10 15:58 PATCH: environ style Oliver Kiddle
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).