erlware / relx

Sane, simple release creation for Erlang
http://erlware.github.io/relx
Apache License 2.0
697 stars 232 forks source link

Extended start script: rpc insists on trailing dot #805

Closed weiss closed 4 years ago

weiss commented 4 years ago

With OTP 22.x (i.e., with nodetool; I didn't test OTP 23.x):

$ myrel rpc 'mod' 'fun' '[arg]'
Error parsing arguments `[arg]`, failed with reason: syntax error before:
$ myrel rpc 'mod' 'fun' '[arg].'
ok

However, myrel eval 'mod:fun(arg)' is happy without trailing dot. Is this intended?

tsloughter commented 4 years ago

It is intended. It matches how erl_call works.

But I now see that nodetool eval will add a . if it isn't there, which erl_call does not do and we need to remove so that when people move to 23 they don't break their scripts.

weiss commented 4 years ago

It matches how erl_call works.

erl_call -a 'mod' 'fun' '[arg]' works for me without trailing ., though.

But I now see that nodetool eval will add a . if it isn't there, which erl_call does not do

Right, erl_call -e insists on the . (and when handing over an expression I'd kinda expect having to terminate it, whereas I didn't really expect having to append a . to [arg]).

tsloughter commented 4 years ago

Thanks, I'll look at that this morning.. I could have swore erl_call required the . on the list. But if it doesn't, then I'll remove it from nodetool as well.

tsloughter commented 4 years ago

I thought I resolved this with a PR but when I look at the only dot based I've had recently it is https://github.com/erlware/relx/pull/806/files

Are they at least consistent now?

weiss commented 4 years ago

I think nodetool was inconsistent with erl_call in two ways:

  1. myrel eval 'mod:fun(arg)'. requires no trailing dot with nodetool but with erl_call.
  2. myrel rpc 'mod' 'fun' '[arg].' requires the trailing dot with nodetool but not with erl_call.

806 fixes the first but not the second inconsistency.

tsloughter commented 4 years ago

Ok, so need to add an automatic inclusion of the period to the rpc args so it isn't required.

weiss commented 4 years ago

Thank you for the fix! I guess this issue can be closed?