aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test/escript_SUITE_data
diff options
context:
space:
mode:
authorMagnus Henoch <[email protected]>2013-01-08 12:35:33 +0000
committerMagnus Henoch <[email protected]>2013-01-08 18:47:16 +0000
commit3f74aa2f7a1ef3703d749edae627cb3766d40434 (patch)
tree66a5dc177a9776b8e87338ee13a537f3ec291e39 /lib/stdlib/test/escript_SUITE_data
parent3e8a6c8bceea8552ef50bd8dcfc14a0f79c9f32e (diff)
downloadotp-3f74aa2f7a1ef3703d749edae627cb3766d40434.tar.gz
otp-3f74aa2f7a1ef3703d749edae627cb3766d40434.tar.bz2
otp-3f74aa2f7a1ef3703d749edae627cb3766d40434.zip
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.
Diffstat (limited to 'lib/stdlib/test/escript_SUITE_data')
-rw-r--r--lib/stdlib/test/escript_SUITE_data/emulator_flags_no_shebang10
1 files changed, 10 insertions, 0 deletions
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]]).