Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: help for writing GNU stow completion
- X-seq: zsh-workers 44681
- From: dana <dana@xxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Subject: Re: help for writing GNU stow completion
- Date: Sat, 17 Aug 2019 16:44:22 -0500
- Cc: Aurélien <orel_jf@xxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Iz8PZVcdsImDE8UHDC6S2RGY/0ZlWT68kvONH0jiSn8=; b=PixZhbi7qmsUdqHBMKjML6tQMtWHgKU5ssSXMO+m58a1FxJbNPKm9Fx4FrUwZmZ+Tq iQX7TlmQZ8695sUTYQJnabGjqzWvRzIgl4f+Xgnp/E4m9f01q9Hh0sJkT+s1yFEfobez RZa/rT3j/v/e6lWxWeLbBM0leifJDe7vajM0EKXb30ayeCFsx/5c+cNuhMWXy+QJnOPn fndRqiAVKxk8e16jaIvax0ZCiWp1hF7LC1Q9p8yIZoA07Ekzk3CvAcYqP2hK9jBNLGiO 1vq+PA13jQ/6UELqiEMfhTeN+AObbN/3gsLpjxzXAnksLM4mEO8oNmXDpTmFofvugupV 1J7A==
- In-reply-to: <0618d7fc-5334-4e51-829a-8684a81744c1@www.fastmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1e5195bb-3126-8d0c-8a6a-1f5a5fd2a6c0@yahoo.fr> <BAE67462-BF39-481A-BCD6-DE288FE6CC92@dana.is> <d30637f3-cbbb-8b93-35f2-421a1a99e1dc@yahoo.fr> <0618d7fc-5334-4e51-829a-8684a81744c1@www.fastmail.com>
On 17 Aug 2019, at 12:53, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> Sorry, but I have to object to the PR as it stands. As I said, using
> «eval $1» causes expressions on the command line to be evaluated
> _when completion is attempted_. To me, that breaks the principle of
> least surprise, and could lead to unexpected and undesired results.
>
> I would strongly prefer another solution, or to be corrected on my
> interpretation that this violates least surprise.
Oh, i didn't notice that the GitHub thing was a PR for zsh.
I agree with this. And i can't think of a general-purpose alternative that's
currently built into the shell.
Apparently i made the same mistake when i wrote _composer, though; attached
replaces the eval by (as i mentioned) what seems to be the prevailing
convention. I think a similar change might be warranted in _git @ 2866?
dana
diff --git a/Completion/Unix/Command/_composer b/Completion/Unix/Command/_composer
index 2b9f2cd32..191350453 100644
--- a/Completion/Unix/Command/_composer
+++ b/Completion/Unix/Command/_composer
@@ -115,7 +115,7 @@ __composer_prune_global_opts() {
(( $+functions[__composer_update_work_dir] )) ||
__composer_update_work_dir() {
if [[ -n ${(v)opt_args[(i)(-d|--working-dir)]} ]]; then
- eval _composer_work_dir=${(v)opt_args[(i)(-d|--working-dir)]}
+ _composer_work_dir=${(Q)${(v)opt_args[(i)(-d|--working-dir)]}}
elif [[ -z $_composer_work_dir ]]; then
_composer_work_dir=$PWD
fi
Messages sorted by:
Reverse Date,
Date,
Thread,
Author