Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: help for writing GNU stow completion



On 15 Aug 2019, at 20:28, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> This would run the code being typed on the command line in cases
> such as «--dir *(+f)» and «--dir $(sudo pwd)», wouldn't it?

Yeah, i guess it would.

On 15 Aug 2019, at 20:28, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> I think you want ${^stow_pkg_list} in the second instance, don't you?

I was assuming that you'd only ever expect a single argument. If the user did
something like `stow --dir=$arr` or `stow --dir=$( print a b c)`, only the
first element of the expansion would be the optarg; any others would probably
be operands.

But then of course it's possible for someone to do like `--dir={a,b,c}` or
`--dir=$^foo`, and at that point i don't think there's *anything* sane you
could do from inside that helper function.

Stuff like that is probably why most functions don't try to do this

dana



Messages sorted by: Reverse Date, Date, Thread, Author