[erlang-questions] Erlang executable that reads command line arguments

Dmitry Kolesnikov <>
Sun Oct 11 12:40:40 CEST 2015

And if you are using rebar and you have deps to other projects you might add following lines to rebar.config
{escript_incl_apps, [ getopt ]}.
 {escript_emu_args, "%%! +K true +P 10000000\n"}.
Sad story, I've not figure out how to add erlang runtime to same package. Anyone, who receives you script needs to have one.

Best Regards,

> On 11 Oct 2015, at 08:46, Frederic BONFANTI <> wrote:
> Hi guys,
> given a simple Erlang code that consists in one file, let’s say test123.erl , I’d like to 
> 1. use a Makefile to compile test123.erl into test.beam and then generate a distributable version of test123 (executable)
> 2. figure-out how to parse the command line arguments once this test command is called from regular shell, for example:
>        test123 -A -x 555
> If there are straightforward examples available, that will do.
> Thanks in advance
> _______________________________________________
> erlang-questions mailing list
> http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20151011/44cb8362/attachment.html>

More information about the erlang-questions mailing list