From: Borsenkow Andrej <Andrej.Borsenkow@mow.siemens.ru>
To: "'Bart Schaefer'" <schaefer@brasslantern.com>,
"'Zsh hackers list'" <zsh-workers@sunsite.dk>
Subject: RE: _call_program (and possibly other hooks) or opt_args quoting prob lem.
Date: Sat, 18 May 2002 15:24:55 +0400 [thread overview]
Message-ID: <6134254DE87BD411908B00A0C99B044F02E89AE4@mowd019a.mow.siemens.ru> (raw)
In-Reply-To: <1020517183916.ZM20203@candle.brasslantern.com>
>
> On May 16, 8:32pm, Borsenkow Andrej wrote:
> }
> } _call_program evals its argument(s). It creates very interesting
problem -
> } we want to quote word separator _but_ we do not want to quote
possible
> } parameter expansions ...
>
> What about this?
>
> Index: Completion/Base/Utility/_call_program
> ===================================================================
> retrieving revision 1.1.1.1
> diff -c -r1.1.1.1 _call_program
> --- Completion/Base/Utility/_call_program 2001/04/09 20:14:08
1.1.1.1
> +++ Completion/Base/Utility/_call_program 2002/05/17 18:38:04
> @@ -4,7 +4,7 @@
>
> if zstyle -s ":completion:${curcontext}:${1}" command tmp; then
> if [[ "$tmp" = -* ]]; then
> - eval "$tmp[2,-1]" "$argv[2,-1]"
> + eval "$tmp[2,-1]" "${(qqq)argv[2,-1]}"
> else
> eval "$tmp"
> fi
>
It won't work in this form; it needs at least ${(@qqq)... and in other
branch. Still even with the following:
if zstyle -s ":completion:${curcontext}:${1}" command tmp; then
if [[ "$tmp" = -* ]]; then
eval "$tmp[2,-1]" "${(qqq)argv[2,-1]}"
else
eval "$tmp"
fi
else
eval "${(@qqq)argv[2,-1]}"
fi
I get
+_info:27> info=( _call_program info info -d $PWD/a b )
+_info:29> items=+_info:1> _call_program info info -d $PWD/a b --output
-
+_call_program:3> local tmp
+_call_program:5> zstyle -s :completion::complete:info::info command tmp
+_call_program:12> eval "info" "-d" "\$PWD/a b" "--output" "-"
Remember, (qqq) _quotes_ arguments (using different rules but it does
not matter).
Actually I begin to feel that _arguments should eval parameter value
before storing it. Can anybody give example when parameter value as it
appears on command line is useful?
-andrej
next prev parent reply other threads:[~2002-05-18 11:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-16 16:32 Borsenkow Andrej
2002-05-17 18:39 ` Bart Schaefer
2002-05-18 11:24 ` Borsenkow Andrej [this message]
2002-05-20 16:40 ` Bart Schaefer
2002-05-20 17:43 ` Borsenkow Andrej
2002-05-21 8:14 ` Sven Wischnowsky
2002-05-21 16:17 ` Bart Schaefer
2002-05-23 12:20 ` Sven Wischnowsky
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=6134254DE87BD411908B00A0C99B044F02E89AE4@mowd019a.mow.siemens.ru \
--to=andrej.borsenkow@mow.siemens.ru \
--cc=schaefer@brasslantern.com \
--cc=zsh-workers@sunsite.dk \
/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).