Elixir CLI could support multiple args
Today, Elixir CLI does not support multiple args. That said, one cannot do:
elixir -pa deps/*/ebin
This is because elixir expects a script to run as argument, as in:
elixir script.exs
Given that elixir -pa deps/*/ebin expands to:
elixir -pa deps/foo/ebin deps/bar/ebin
It becomes ambiguous and therefore won't work. Today, Elixir requires you to quote:
elixir -pa "deps/*/ebin"
And then Elixir will expand it internally. Another alternative would be to require an explicit command when a file needs to be run, as in:
elixir -R path/to/file arg1 arg2
elixir -- path/to/file arg1 arg2
So, how should we proceed:
- Leave it as is and require quoting (one advantage of leaving the expansion to Elixir is that it is not OS nor terminal specific, but it may confuse Erlang users)
- Allow multiple args which may make running scripts with Elixir a bit more verbose but more consistent with Erlang
I got into this problem... I thought it was confused when I tried to require a path that expands on elixir. That's cause I was used to the Erlang syntax.
So personally, I think that it would be better allow multiple args running. But I'm also not against to leave the double quotes. Which may be better technically...
I got in this problem too in the early version of Elixir (I think pior to 0.5) and we discussed about it. And we reached the decision that the use of quote would be better and less ambiguos.
I'm with the same opinion.
I remember that we discussed this because of this https://github.com/elixir-lang/exdoc/commit/8d570961e8b3ebd6574f74dfbfa1138b0c3b60f8#L1R21