1995-08-09 08:06:35 -07:00
|
|
|
(***********************************************************************)
|
|
|
|
(* *)
|
1996-04-30 07:53:58 -07:00
|
|
|
(* Objective Caml *)
|
1995-08-09 08:06:35 -07:00
|
|
|
(* *)
|
|
|
|
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
|
|
|
|
(* *)
|
1996-04-30 07:53:58 -07:00
|
|
|
(* Copyright 1996 Institut National de Recherche en Informatique et *)
|
1999-11-17 10:59:06 -08:00
|
|
|
(* en Automatique. All rights reserved. This file is distributed *)
|
|
|
|
(* under the terms of the Q Public License version 1.0. *)
|
1995-08-09 08:06:35 -07:00
|
|
|
(* *)
|
|
|
|
(***********************************************************************)
|
|
|
|
|
|
|
|
(* $Id$ *)
|
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
open Clflags
|
|
|
|
|
2000-02-06 19:29:29 -08:00
|
|
|
let usage = "Usage: ocaml <options> [script-file]\noptions are:"
|
1996-10-24 07:17:48 -07:00
|
|
|
|
1997-07-03 07:32:35 -07:00
|
|
|
let file_argument name =
|
2000-03-06 14:12:09 -08:00
|
|
|
exit (if Toploop.run_script Format.err_formatter name Sys.argv then 0 else 2)
|
1997-07-03 07:32:35 -07:00
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
let main () =
|
1996-10-24 07:17:48 -07:00
|
|
|
Arg.parse [
|
|
|
|
"-I", Arg.String(fun dir -> include_dirs := dir :: !include_dirs),
|
|
|
|
"<dir> Add <dir> to the list of include directories";
|
2000-03-24 11:31:25 -08:00
|
|
|
"-labels", Arg.Clear classic, " Use commuting label mode";
|
|
|
|
"-modern", Arg.Clear classic, " (deprecated) same as -labels";
|
1999-11-29 11:04:45 -08:00
|
|
|
"-noassert", Arg.Set noassert, " Do not compile assertion checks";
|
1999-11-19 01:11:02 -08:00
|
|
|
"-rectypes", Arg.Set recursive_types, " Allow arbitrary recursive types";
|
1996-10-24 07:17:48 -07:00
|
|
|
"-unsafe", Arg.Set fast, " No bound checking on array and string access";
|
1999-11-29 11:04:45 -08:00
|
|
|
"-w", Arg.String Warnings.parse_options,
|
|
|
|
"<flags> Enable or disable warnings according to <flags>:\n\
|
|
|
|
\032 A/a enable/disable all warnings\n\
|
|
|
|
\032 C/c enable/disable suspicious comment\n\
|
|
|
|
\032 F/f enable/disable partially applied function\n\
|
|
|
|
\032 M/m enable/disable overriden method\n\
|
|
|
|
\032 P/p enable/disable partial match\n\
|
|
|
|
\032 S/s enable/disable non-unit statement\n\
|
|
|
|
\032 U/u enable/disable unused match case\n\
|
|
|
|
\032 V/v enable/disable hidden instance variable\n\
|
|
|
|
\032 X/x enable/disable all other warnings\n\
|
|
|
|
\032 default setting is A (all warnings enabled)";
|
|
|
|
|
|
|
|
"-dparsetree", Arg.Set dump_parsetree, " (undocumented)";
|
1996-10-24 07:17:48 -07:00
|
|
|
"-drawlambda", Arg.Set dump_rawlambda, " (undocumented)";
|
|
|
|
"-dlambda", Arg.Set dump_lambda, " (undocumented)";
|
1999-11-19 01:11:02 -08:00
|
|
|
"-dinstr", Arg.Set dump_instr, " (undocumented)"
|
1997-07-03 07:32:35 -07:00
|
|
|
] file_argument usage;
|
2000-04-10 07:59:29 -07:00
|
|
|
Toploop.loop Format.std_formatter
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
let _ = Printexc.catch main ()
|