From: "Benjamin R. Haskell" <zsh@benizi.com>
To: Zsh Workers <zsh-workers@zsh.org>
Subject: Re: [PATCH] env completion: add missing explanation of --unset option, fixes alignment of completed arguments
Date: Thu, 12 Nov 2009 15:52:50 -0500 (EST) [thread overview]
Message-ID: <alpine.LNX.2.01.0911121548300.26715@hp.internal> (raw)
In-Reply-To: <1258056819-4409-1-git-send-email-ingmar@exherbo.org>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 792 bytes --]
On Thu, 12 Nov 2009, Ingmar Vanhassel wrote:
> ---
> Completion/Unix/Command/_env | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> I was getting a few patch series ready to send, but I guess I can fire this one
> off already, it probably fixes your issue.
>
> What I've not figured out, is how to make 'env FOO=bar quux <TAB>' complete
> options to 'quux'. I guess that'll take someone with more experience than me.
Took a hint from _xargs... Attached patch incorporates:
1. my fix to allow multiple '-u/--unset=' args
2. Ingmar's documentation fix
3. the fix to complete arguments to the command passed to 'env'
Does not include the '(--unset= -u)' Ingmar had prepended to the '-u'
line. (I think that would explicitly prevent multiple -u/--unset args.)
Best,
Ben
[-- Attachment #2: Type: TEXT/PLAIN, Size: 866 bytes --]
Index: Completion/Unix/Command/_env
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_env,v
retrieving revision 1.1
diff -u -r1.1 _env
--- Completion/Unix/Command/_env 13 Apr 2006 02:46:50 -0000 1.1
+++ Completion/Unix/Command/_env 12 Nov 2009 20:47:25 -0000
@@ -3,9 +3,10 @@
if _pick_variant gnu=Free\ Soft unix --version; then
_arguments \
'(--ignore-environment -i)'{-i,--ignore-environment}'[start with empty environment]' \
- {-u,--unset=}':env var to remove:compadd ${(k)parameters[(R)*export*]}' \
+ '*'{-u,--unset=}'[remove variable from the environment]:env var to remove:compadd ${(k)parameters[(R)*export*]}' \
'--help[help]' \
'--version[version]' \
+ '(-):command: _command_names -e' \
'*::arguments: _normal'
else
_precommand
next prev parent reply other threads:[~2009-11-12 20:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <alpine.LNX.2.01.0911121446150.26715@hp.internal>
2009-11-12 20:13 ` Ingmar Vanhassel
2009-11-12 20:52 ` Benjamin R. Haskell [this message]
2009-11-12 21:16 ` Ingmar Vanhassel
2009-11-12 21:46 ` Benjamin R. Haskell
2009-11-13 13:47 ` Stephane Chazelas
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=alpine.LNX.2.01.0911121548300.26715@hp.internal \
--to=zsh@benizi.com \
--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).