Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: environ style
- X-seq: zsh-workers 30198
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: environ style
- Date: Fri, 10 Feb 2012 16:58:42 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1328889523; bh=3WXleqFDRlDZ2dcnYZnE2V0aCUMnGSlYyr49exWl2P0=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Received:From:To:Subject:Date:Message-ID; b=x8iykL4nQCLbM3Q9UViflLkcwK9CtTJVQuRT0X2RVXgmot/BCHfVBT9AD4hCFSdk/FTypctSm2RFpuOK5Lm6p2Nu/Yj1+oZzJCieLlmr5B33rKGFn1AEsb3tCcZ/Vf9uAf0fRvO6QV0wt2W/Lfhoo6wJMR3DKuBS6kdQCFOMTzw=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author