my requirements are single file (distillery-release) and the possibility to pass some command line arguments
in the style of
./script --verbose --host=x or --host x
I do not need any stuff like console, start, run, remote_console, attach whatever, so foreground should be used automatically
If this is really impossible with elixir then ok I have to use golang
This sounds much more like you need an
escript rather than a release…
Anyway, I asked something similar recently in the distillery slack, and I have been pointed to custom commands and told that I should start the application from there and do a lot of glueing…
And all I wanted was a single flag to indicate location of the configuration file if non-default…
I was able to convince higher instances to use an environment variable instead.
escript looks nice, but what should I do if it is not possible to have erlang installed on the target machines ?
For what reasons?
Anyway, creating a custom command is probably the way to go then.
In theory it should be possible, but no one has actually tried yet…
Well you could make a self-extracting and self-executing file, easy to package that up. Or make a flatpak or snap, or a docker instance, or all kinds of things.
Remember the BEAM is made for making distributed servers, not little single-file commandline tools, things like python/ocaml/C++/rust/go and so forth are better for that (but are all pretty bad at making distributed servers).