From 3f74aa2f7a1ef3703d749edae627cb3766d40434 Mon Sep 17 00:00:00 2001 From: Magnus Henoch Date: Tue, 8 Jan 2013 12:35:33 +0000 Subject: escript to accept emulator arguments when script file has no shebang According to the documentation, if the second or third line in a script starts with %%!, then escript will use the rest of the line as emulator options. However, previously this was only the case if the first line started with #!. This change removes that check, and unconditionally uses the %%! line if present. --- lib/stdlib/test/escript_SUITE_data/emulator_flags_no_shebang | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 lib/stdlib/test/escript_SUITE_data/emulator_flags_no_shebang (limited to 'lib/stdlib/test/escript_SUITE_data/emulator_flags_no_shebang') diff --git a/lib/stdlib/test/escript_SUITE_data/emulator_flags_no_shebang b/lib/stdlib/test/escript_SUITE_data/emulator_flags_no_shebang new file mode 100644 index 0000000000..47d843ebe1 --- /dev/null +++ b/lib/stdlib/test/escript_SUITE_data/emulator_flags_no_shebang @@ -0,0 +1,10 @@ +%% -*- erlang -*- +%%! -nostick -mnesia dir a/directory -mnesia debug verbose + +main(MainArgs) -> + io:format("main:~p\n",[MainArgs]), + ErlArgs = init:get_arguments(), + io:format("nostick:~p\n",[[E || E <- ErlArgs, element(1, E) =:= nostick]]), + io:format("mnesia:~p\n", [[E || E <- ErlArgs, element(1, E) =:= mnesia]]), + io:format("ERL_FLAGS=~p\n", [os:getenv("ERL_FLAGS")]), + io:format("unknown:~p\n",[[E || E <- ErlArgs, element(1, E) =:= unknown]]). -- cgit v1.2.3