-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.ml
49 lines (44 loc) · 1.8 KB
/
options.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
(* ----------------------------------------------------------------------------
* SchedMCore - A MultiCore Scheduling Framework
* Copyright (C) 2012, ONERA, Toulouse, FRANCE
*
* This file is part of Mince
*
* Mince is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Mince is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*---------------------------------------------------------------------------- *)
open Printf
let version = "0.1"
let outname = ref "main"
let outdir = ref ""
let inname = ref ""
let opt = ref 0
let dot = ref false
let verbose = ref false
let options =
[ "-out", Arg.Set_string outname, " Specifies the name for output files";
"-d", Arg.Set_string outdir, " Specifies the directory for output files";
"-dot", Arg.Set dot, " Dump task graph to .dot file";
"-verbose", Arg.Set verbose, " Output detailed messages about what the compiler is doing";
"-version", Arg.Unit (fun () -> print_endline (Sys.argv.(0) ^ " " ^ version); exit 0), " Display the version" ]
let usage = Sys.argv.(0) ^ " <options> [<file>]"
let parse =
Arg.parse options
(fun x ->
if !inname = "" then
inname := x
else
raise (Arg.Bad "Cannot handle more than one input file"))
usage