2 ||M|| This file is part of HELM, an Hypertextual, Electronic
3 ||A|| Library of Mathematics, developed at the Computer Science
4 ||T|| Department, University of Bologna, Italy.
6 ||T|| HELM is free software; you can redistribute it and/or
7 ||A|| modify it under the terms of the GNU General Public License
8 \ / version 2 or (at your option) any later version.
9 \ / This software is distributed as is, NO WARRANTY.
10 V_______________________________________________________________ *)
16 module R = Helm_registry
25 let help_O = "<dir> Set this output directory"
26 let help_X = " Clear configuration and options"
27 let help_a = " Log alpha-unconverted identifiers (default: no)"
28 let help_c = " Check term transformations (default: no)"
29 let help_g = " Global alpha-conversion (default: no)"
30 let help_l = "<file> Output the list of generated files in this file"
31 let help_m = " Log missing notational macros (default: no)"
32 let help_p = " Omit proofs (default: no)"
33 let help_t = " Omit types (default: no)"
37 (* internal functions *******************************************************)
39 let alpha_decode = R.triple R.string R.string R.string
41 let const_decode = R.pair R.string R.string
43 let macro_decode = R.quad R.string R.string R.int R.int
47 if !G.no_init then begin
51 G.alpha_type := R.get_list alpha_decode "matex.alpha.type";
52 G.alpha_sort := R.get_list alpha_decode "matex.alpha.sort";
53 G.alpha_gref := R.get_list const_decode "matex.alpha.gref";
54 G.macro_gref := R.get_list macro_decode "matex.notation.const"
57 F.check_suffix s ".conf.xml"
60 failwith "MaTeX: main: registry not initialized"
63 failwith ("MaTeX: main: malformed argument: " ^ s)
66 let file = F.concat !G.out_dir fname in
67 G.close_list (); G.list_och := Some (open_out file)
70 if is_registry s then init s
71 else if !G.no_init then no_init ()
72 else if L.is_uri s then E.process (U.uri_of_string s)
78 "-O", A.String ((:=) G.out_dir), help_O;
79 "-X", A.Unit G.clear, help_X;
80 "-a", A.Set G.log_alpha, help_a;
81 "-c", A.Set G.check, help_c;
82 "-g", A.Set G.global_alpha, help_g;
83 "-l", A.String set_list, help_l;
84 "-m", A.Set G.log_missing, help_m;
85 "-p", A.Set G.no_proofs, help_p;
86 "-t", A.Set G.no_types, help_t;
89 | X.Error s -> X.log s