]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/lambda-delta/toplevel/top.ml
autItem : the uris of the objects involved in the implicit coercions
[helm.git] / helm / software / lambda-delta / toplevel / top.ml
index a2bac561661082a29e39d81b9a701dfacc958f59..06df1ab0355073ead0243322302014a2c095431a 100644 (file)
@@ -38,8 +38,10 @@ let initial_status = {
 let count count_fun c item =
    if !L.level > 2 then count_fun C.start c item else c
 
+let flush () = L.flush (); L.flush_err ()
+
 let brg_error s msg =
-   L.error BrgO.specs (L.Warn s :: msg) 
+   L.error BrgO.specs (L.Warn s :: msg); flush () 
 
 let main =
 try 
@@ -81,9 +83,9 @@ try
          | []         -> st
         | item :: tl ->
 (* stage 3 *)
-           let f st = function
-              | None                -> st
-              | Some (_, (i, u, _)) -> 
+           let f st = function
+              | None           -> st
+              | Some (i, u, _) -> 
                  Log.warn (P.sprintf "[%u] %s" i (U.string_of_uri u)); st
            in
 (* stage 2 *)      
@@ -116,23 +118,27 @@ try
       if !L.level > 2 && !stage > 1 then BrgO.print_counters C.start st.brgc;
    in
    let help = 
-      "Usage: helena [ -V | -Ss <number> | -m <file> | -h <string> ] <file> ...\n\n" ^
+      "Usage: helena [ -Vi | -Ss <number> | -m <file> | -h <string> ] <file> ...\n\n" ^
       "Summary levels: 0 just errors, 1 time stamps, 2 processed file names, \
        3 data information, 4 typing information, 5 reduction information\n\n" ^
        "Stages: 0 parsing, 1 to intermediate, 2 to untrusted, 3 to trusted\n"
    in
-   let help_S = "<number>  Set summary level" in
-   let help_V = " Show version information" in   
+   let help_S = "<number>  set summary level" in
+   let help_V = " show version information" in   
    let help_h = "<string>  set type hierarchy" in
+   let help_i = " show local references by index" in
    let help_m = "<file>  output intermediate representation" in
    let help_s = "<number>  Set translation stage" in
+   L.box (); L.box_err ();
    H.set_new_sorts ignore ["Set"; "Prop"];
    Arg.parse [
       ("-S", Arg.Int set_summary, help_S);
       ("-V", Arg.Unit print_version, help_V);
       ("-h", Arg.String set_hierarchy, help_h);
+      ("-i", Arg.Set BrgO.indexes, help_i);
       ("-m", Arg.String set_meta_file, help_m); 
       ("-s", Arg.Int set_stage, help_s);
    ] read_file help;
-   if !L.level > 0 then Time.utime_stamp "at exit"
+   if !L.level > 0 then Time.utime_stamp "at exit";
+   flush ()
 with BrgType.TypeError msg -> brg_error "Type Error" msg