2
votes

I'm sure this will be so simple I will kick myself my asking but how do I pass erl args, like -config {file} to erl when calling rebar shell? I thought it would simply passthrough anything that didn't match it's own switches but not so.

3

3 Answers

3
votes

rebar shell doesn't appear to allow arguments, but it's basically the equivalent of the following command line:

erl -pa deps/*/ebin -pa ebin

If your project has no dependencies, you don't need the -pa deps/*/ebin part. If you need extra arguments, just add them to this command.

Another alternative is to use the ERL_FLAGS environment variable to specify extra arguments:

ERL_FLAGS='-config my_config_file.config' rebar shell
1
votes

rebar3 supports this directly now:

  • rebar3 shell --config something.config, or
  • Add {shell, [{config, "something.config}]}. to your rebar.config
0
votes

It's not elegant modify everytime your rebar.config but you can use the tuple {sys_config, FilePath}.

{sys_config, "config/sys.config"}.

When you run the command "rebar3 shell", they will load the configuration placed in "config/sys.config"