53
let print_version_num () =
54
Printf.printf "%s\n" Sys.ocaml_version;
58
module Options = Main_args.Make_bytetop_options (struct
59
let set r () = r := true
60
let clear r () = r := false
63
let dir = Misc.expand_directory Config.standard_library dir in
64
include_dirs := dir :: !include_dirs
65
let _init s = init_file := Some s
66
let _labels = clear classic
67
let _no_app_funct = clear applicative_functors
68
let _noassert = set noassert
69
let _nolabels = set classic
70
let _noprompt = set noprompt
71
let _nostdlib = set no_std_include
72
let _principal = set principal
73
let _rectypes = set recursive_types
74
let _strict_sequence = set strict_sequence
75
let _unsafe = set fast
76
let _version () = print_version ()
77
let _vnum () = print_version_num ()
78
let _w s = Warnings.parse_options false s
79
let _warn_error s = Warnings.parse_options true s
80
let _warn_help = Warnings.help_warnings
81
let _dparsetree = set dump_parsetree
82
let _drawlambda = set dump_rawlambda
83
let _dlambda = set dump_lambda
84
let _dinstr = set dump_instr
86
let anonymous s = file_argument s
55
"-I", Arg.String(fun dir ->
56
let dir = Misc.expand_directory Config.standard_library dir in
57
include_dirs := dir :: !include_dirs),
58
"<dir> Add <dir> to the list of include directories";
59
"-init", Arg.String (fun s -> init_file := Some s),
60
"<file> Load <file> instead of default init file";
61
"-labels", Arg.Clear classic, " Labels commute (default)";
62
"-noassert", Arg.Set noassert, " Do not compile assertion checks";
63
"-nolabels", Arg.Set classic, " Ignore labels and do not commute";
64
"-noprompt", Arg.Set noprompt, " Suppress all prompts";
65
"-nostdlib", Arg.Set no_std_include,
66
" do not add default directory to the list of include directories";
67
"-principal", Arg.Set principal, " Check principality of type inference";
68
"-rectypes", Arg.Set recursive_types, " Allow arbitrary recursive types";
69
"-unsafe", Arg.Set fast, " No bound checking on array and string access";
70
"-version", Arg.Unit print_version, " Print version and exit";
71
"-w", Arg.String (Warnings.parse_options false),
72
"<flags> Enable or disable warnings according to <flags>:\n\
73
\032 A/a enable/disable all warnings\n\
74
\032 C/c enable/disable suspicious comment\n\
75
\032 D/d enable/disable deprecated features\n\
76
\032 E/e enable/disable fragile match\n\
77
\032 F/f enable/disable partially applied function\n\
78
\032 L/l enable/disable labels omitted in application\n\
79
\032 M/m enable/disable overriden method\n\
80
\032 P/p enable/disable partial match\n\
81
\032 S/s enable/disable non-unit statement\n\
82
\032 U/u enable/disable unused match case\n\
83
\032 V/v enable/disable hidden instance variable\n\
84
\032 Y/y enable/disable suspicious unused variables\n\
85
\032 Z/z enable/disable all other unused variables\n\
86
\032 X/x enable/disable all other warnings\n\
87
\032 default setting is \"Aelz\"";
88
"-warn-error" , Arg.String (Warnings.parse_options true),
89
"<flags> Treat the warnings of <flags> as errors, if they are enabled.\n\
90
\032 (see option -w for the list of flags)\n\
91
\032 default setting is a (all warnings are non-fatal)";
93
"-dparsetree", Arg.Set dump_parsetree, " (undocumented)";
94
"-drawlambda", Arg.Set dump_rawlambda, " (undocumented)";
95
"-dlambda", Arg.Set dump_lambda, " (undocumented)";
96
"-dinstr", Arg.Set dump_instr, " (undocumented)";
97
] file_argument usage;
91
Arg.parse Options.list file_argument usage;
98
92
if not (prepare Format.err_formatter) then exit 2;
99
93
Toploop.loop Format.std_formatter