Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: environ style



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