42 lines
1.7 KiB
Bash
Executable File
42 lines
1.7 KiB
Bash
Executable File
#!/bin/sh
|
||
if [ $# -gt 0 ] && ([ "$1" = "--help" ] || [ "$1" = "-h" ]); then
|
||
echo "Usage: `basename $0` [options] [.exs file] [data]
|
||
|
||
-v Prints version
|
||
-e \"command\" Evaluates the given command (*)
|
||
-r \"file\" Requires the given files/patterns (*)
|
||
-S \"script\" Finds and executes the given script
|
||
-pr \"file\" Requires the given files/patterns in parallel (*)
|
||
-pa \"path\" Prepends the given path to Erlang code path (*)
|
||
-pz \"path\" Appends the given path to Erlang code path (*)
|
||
--app \"app\" Start the given app and its dependencies (*)
|
||
--erl \"switches\" Switches to be passed down to erlang (*)
|
||
--name \"name\" Makes and assigns a name to the distributed node
|
||
--sname \"name\" Makes and assigns a short name to the distributed node
|
||
--cookie \"cookie\" Sets a cookie for this distributed node
|
||
--hidden Makes a hidden node
|
||
--detached Starts the Erlang VM detached from console
|
||
--remsh \"name\" Connects to a node using a remote shell
|
||
--dot-iex \"path\" Overrides default .iex file and uses path instead;
|
||
path can be empty, then no file will be loaded
|
||
|
||
** Options marked with (*) can be given more than once
|
||
** Options given after the .exs file or -- are passed down to the executed code
|
||
** Options can be passed to the erlang runtime using ELIXIR_ERL_OPTS or --erl" >&2
|
||
exit 1
|
||
fi
|
||
|
||
readlink_f () {
|
||
cd "$(dirname "$1")" > /dev/null
|
||
filename="$(basename "$1")"
|
||
if [ -h "$filename" ]; then
|
||
readlink_f "$(readlink "$filename")"
|
||
else
|
||
echo "`pwd -P`/$filename"
|
||
fi
|
||
}
|
||
|
||
SELF=$(readlink_f "$0")
|
||
SCRIPT_PATH=$(dirname "$SELF")
|
||
ELIXIR_NO_CLI=1 exec "$SCRIPT_PATH"/elixir --no-halt --erl "-user Elixir.IEx.CLI" +iex "$@"
|