zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Zsh workers <zsh-workers@zsh.org>
Subject: PATCH: environ style
Date: Fri, 10 Feb 2012 16:58:42 +0100	[thread overview]
Message-ID: <23234.1328889522@thecus.kiddle.eu> (raw)

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)


                 reply	other threads:[~2012-02-10 16:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=23234.1328889522@thecus.kiddle.eu \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).