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

Re: Proof of concept mainstream plugin manager

On 28 January 2016 at 07:38, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> Oh.  Yes, you need to pass empty string there if there are no options,
> because _reload_and_run interprets its first 3 arguments positionally
> and all are required to be present.  Sorry about that.
> So if you want to use the assignment form, you need
> functions[$func]="_reload_and_run ${(q)PLUGIN_DIR} ${${(q)opts[@]}} $func "'"$@"'
> The ${(qq)opts[@]} quotes every element separately, and then the outer
> ${...} compbines the result into a single string again.

I still get the same behavior

> Back on the first hand, I suppose if $func somehow contains a semicolon
> or some globbing characters, rather than just spaces, then you should
> quote those.  So yes, ${(q)func} is better.

Did one test. There is one simple plugin calc, which does:

function =
  echo "$@" | bc -l

If I convert this into autoload function it doesn't break without (q)
in ${(q)func}. That said, I'll better stick with (q).

Best regards,
Sebastian Gniazdowski

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