[m-rev.] diff: pass option args to erlang program

Peter Wang wangp at students.csse.unimelb.edu.au
Thu Jun 14 12:28:30 AEST 2007


Estimated hours taken: 0.2
Branches: main

compiler/modules.m:
	In the Erlang shell script, use -extra instead of -- to separate
	arguments intended for the Erlang runtime system from those intended
	for the user program, which is needed for -flag and +flag arguments
	to be passed to the user program.

Index: compiler/modules.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.431
diff -u -r1.431 modules.m
--- compiler/modules.m	13 Jun 2007 02:48:40 -0000	1.431
+++ compiler/modules.m	14 Jun 2007 02:09:47 -0000
@@ -8285,6 +8285,8 @@
             SearchProg = pa_option(no, """$DIR""/" ++ quote_arg(BeamDirName)),
 
             % Write the shell script.
+            % Note we need to use '-extra' instead of '--' for "-flag" and
+            % "+flag" arguments to be pass through to the Mercury program.
             io.write_strings(ShellScript, [
                 "#!/bin/sh\n",
                 "# Generated by the Mercury compiler.\n",
@@ -8292,7 +8294,7 @@
                 "exec ", Erlang, " -noshell \\\n",
                 SearchStdLib, SearchLibs, SearchProg,
                 " -s ", BeamBaseNameNoExt, " ", MainFunc,
-                " -s init stop -- ""$@""\n"
+                " -s init stop -extra ""$@""\n"
             ], !IO),
             io.close_output(ShellScript, !IO),
 
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list