[m-rev.] diff: add --flags

Zoltan Somogyi zs at cs.mu.OZ.AU
Mon Feb 14 16:46:45 AEDT 2005


This is for both branches.

Zoltan.

compiler/options.m:
	Add a new option, --flags, also available as --flags-file, that allows
	the options to come from a file.

doc/user_guide.texi:
	Document the new option.

Index: compiler/options.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/options.m,v
retrieving revision 1.442
diff -u -b -r1.442 options.m
--- compiler/options.m	2 Feb 2005 02:58:42 -0000	1.442
+++ compiler/options.m	11 Feb 2005 06:57:33 -0000
@@ -25,19 +25,20 @@
 :- pred long_option(string::in, option::out) is semidet.
 :- pred option_defaults(option::out, option_data::out) is nondet.
 
+	% special_handler(Option, ValueForThatOption, OptionTableIn,
+	%	MaybeOptionTableOut):
+	% This predicate is invoked whenever getopt finds an option
+	% (long or short) designated as special, with special_data holding
+	% the argument of the option (if any). The predicate can change the
+	% option table in arbitrary ways in the course of handling the option,
+	% or it can return an error message.
+	% The canonical examples of special options are -O options in
+	% compilers, which set many other options at once.
+	% The MaybeOptionTableOut may either be ok(OptionTableOut), or it may
+	% be error(ErrorString).
+	%
 :- pred special_handler(option::in, special_data::in, option_table::in,
 	maybe_option_table::out) is semidet.
-%	special_handler(Option, ValueForThatOption, OptionTableIn,
-%			MaybeOptionTableOut).
-%	This predicate is invoked whenever getopt finds an option
-%	(long or short) designated as special, with special_data holding
-%	the argument of the option (if any). The predicate can change the
-%	option table in arbitrary ways in the course of handling the option,
-%	or it can return an error message.
-%	The canonical examples of special options are -O options in compilers,
-%	which set many other options at once.
-%	The MaybeOptionTableOut may either be ok(OptionTableOut), or it may
-%	be error(ErrorString).
 
 :- pred options_help(io::di, io::uo) is det.
 
@@ -677,6 +678,7 @@
 		;	mercury_configuration_directory_special
 		;	install_command
 		;	libgrades
+		;	flags_file
 		;	options_files
 		;	config_file
 		;	options_search_directories
@@ -1316,6 +1318,7 @@
 	mercury_configuration_directory - maybe_string(no),
 	install_command		-	string("cp"),
 	libgrades		-	accumulating([]),
+	flags_file		-	file_special,
 	options_files		-	accumulating(["Mercury.options"]),
 
 					% yes("") means unset.
@@ -1994,6 +1997,8 @@
 long_option("use-symlinks",		use_symlinks).
 long_option("library-grade",		libgrades).
 long_option("libgrade",			libgrades).
+long_option("flags",			flags_file).
+long_option("flags-file",		flags_file).
 long_option("options-file",		options_files).
 long_option("config-file",		config_file).
 long_option("options-search-directory", options_search_directories).
@@ -4142,6 +4147,10 @@
 		"--libgrade <grade>",
 		"\tAdd <grade> to the list of compilation grades in",
 		"\twhich a library to be installed should be built.",
+		"--flags <file>",
+		"--flags-file <file>",
+		"\tTake options from the specified file, and handle them",
+		"\tas if they were specified on the command line.",
 		"--options-file <file>",
 		"\tAdd <file> to the list of options files to be processed.",
 		"\tIf <file> is `-', an options file will be read from the",
cvs diff: Diffing doc
Index: doc/user_guide.texi
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/doc/user_guide.texi,v
retrieving revision 1.417
diff -u -b -r1.417 user_guide.texi
--- doc/user_guide.texi	10 Feb 2005 04:10:28 -0000	1.417
+++ doc/user_guide.texi	11 Feb 2005 06:57:31 -0000
@@ -7249,6 +7249,14 @@
 which a library to be installed should be built.
 
 @sp 1
+ at item --flags @var{file}
+ at itemx --flags-file @var{file}
+ at findex --flags
+ at findex --flags-file
+Take options from the specified file, and handle them
+as if they were specified on the command line.
+
+ at sp 1
 @item --options-file @var{file}
 @findex --options-file
 @cindex Options files
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list