Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: help for writing GNU stow completion
- X-seq: zsh-workers 44707
- From: dana <dana@xxxxxxx>
- To: Aurélien <orel_jf@xxxxxxxx>
- Subject: Re: help for writing GNU stow completion
- Date: Sat, 24 Aug 2019 20:14:17 -0500
- Cc: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>, 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=5uydaYhVY60aeM7jccjN29GLf37NXBgDnJ1z0RdAAgs=; b=1XiCVgztZgJa4LdmwDXSr/mXZeRPwj8S/dUIfX03ixCbyj3OMdER7T0Ds7z2a/ufL4 YqQglKVXFbMwoI7AIIZC5wJHctuT01zhpxkYclStoVMEKG/De0er9/3rr/Dd3hSqW+wa v8GORPZXoR8VNKikk1RIItuM1NBmaARvwSE3fBVJ9gNTvVtiP9lW65p9WVr91+uFNdvh 1CQqpM79fuBQ5iJh+XYhjDRTeZgG6Sp3+8n0hy6dBGLaFDBwk/F/cleillRhx4hYsOd7 LI7TgWbQDqSKFTdNdRNZUsiyYBFEr+UVIGC3fGw93n6IKBgbpPQqZcaf/9SQhliJSlNO BTBQ==
- In-reply-to: <558a3ff8-d6f1-9ab0-3387-a17ca5e0e75b@yahoo.fr>
- 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> <558a3ff8-d6f1-9ab0-3387-a17ca5e0e75b@yahoo.fr>
(idk what's up with the ???? here, it says UTF-8 but it's all messed up)
On 20 Aug 2019, at 12:45, Aurélien <orel_jf@xxxxxxxx> wrote:
> But now if I do ?? stow --dir=$HOME/.dotfiles<TAB> ??, I get ????no packages
> found in $HOME/.dotfiles????. Maybe I missed something???
It's because of what i said before — the argument you're passing to that
helper function is the raw, unevaluated text from the command line, so it
isn't expanding $HOME. The only easy way i can think of to *make* a completion
function expand that is to evaluate it, which you can do with eval or, as i
forgot to mention before, the (e) expansion flag. But if you do that, there is
a chance (though probably not a huge one) that you might trigger unexpected
and potentially even destructive side-effects when the user invokes
completion, which is why Daniel objected to it.
If there were some kind of 'safe eval' that just performed 'read-only'
parameter expansions, you could use that, but as far as i know there isn't
currently anything like that that's built into the shell, and it's not ideal
to special-case this one function.
So, without a general solution, the more limited version in your last message
might be the best option for now
dana
Messages sorted by:
Reverse Date,
Date,
Thread,
Author