]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/bin/roles/roles.ml
update in binaries for λδ
[helm.git] / matita / matita / contribs / lambdadelta / bin / roles / roles.ml
index 1c7866e47f9c148a1cd4a615a7ea0a4aa4bcc0a5..14c0decc31599fbf9dbae139ef69cce12920d3b5 100644 (file)
@@ -13,35 +13,61 @@ module EE = RolesEngine
 module EG = RolesGlobal
 module ET = RolesTypes
 module EU = RolesUtils
+module WE = WebEngine
 
-let help_C = "<dir>  Set this working directory (default: current directory)"
+let help_B = "<url>  Set this base url (default: http://helm.cs.unibo.it/lambdadelta/)"
+let help_C = "<dir>  Set this relative working directory (default: invocation directory)"
 let help_L = " Debug osn lexer"
+let help_W = " Run as an LWS application"
 let help_X = " Reset all options to defaults"
+let help_a = " Add selected names to a role"
+let help_d = " Remove selected names from roles"
+let help_m = " Add roles relating matching names"
+let help_n = "<version>  Start a stage with this version"
+let help_p = " Print current status on standard output"
 let help_r = " Load current status"
-let help_s = "<version>  Start a stage with this version"
-let help_t = "<pointer>  Toggle the selection of this pointed entry"
+let help_s = "<pointer>  Toggle the selection of this pointed entry"
+let help_t = "<version>  Add top objects for this stage"
 let help_w = " Save current status"
-let help   = "Usage: roles [ -LXrw | -C <dir> | -s <version> | -t <pointer> | <file> ]*"
+let help_x = "<pointer>  Toggle the expansion of this pointed entry"
+let help   = "Usage: roles [ -LWXadmprw | -B <url> | -C <dir> | -nt <version> | -sx <pointer> | <file> ]*"
+
+let change_cwd s =
+  EG.cwd := Filename.concat !EG.cwd s
+
+let add_tops s =
+  EE.add_tops (EU.version_of_string s)
 
 let new_stage s =
   EE.new_stage (EU.version_of_string s)
 
-let toggle_entry s =
-  EE.toggle_entry (EU.pointer_of_string s)
+let select_entry s =
+  EE.select_entry (EU.pointer_of_string s)
+
+let expand_entry s =
+  EE.expand_entry (EU.pointer_of_string s)
 
 let process s =
   match Filename.extension s with
   | ".txt" -> EE.read_waiting s
-  | x      -> EU.raise_error (ET.EExt x)
+  | x      -> EU.raise_error (ET.EWrongExt x)
 
 let _main = try
   Arg.parse [
-    "-C", Arg.String ((:=) EG.wd), help_C;
+    "-B", Arg.String ((:=) EG.base_url), help_B;
+    "-C", Arg.String change_cwd, help_C;
     "-L", Arg.Set EG.debug_lexer, help_L;
+    "-W", Arg.Unit WE.init, help_W;
     "-X", Arg.Unit EG.clear, help_X;
+    "-a", Arg.Unit EE.add_role, help_a;
+    "-d", Arg.Unit EE.remove_roles, help_d;
+    "-m", Arg.Unit EE.add_matching, help_m;
+    "-n", Arg.String new_stage, help_n;
+    "-p", Arg.Unit EE.print_status, help_p;
     "-r", Arg.Unit EE.read_status, help_r;
-    "-s", Arg.String new_stage, help_s;
-    "-t", Arg.String toggle_entry, help_t;
+    "-s", Arg.String select_entry, help_s;
+    "-t", Arg.String add_tops, help_t;
     "-w", Arg.Unit EE.write_status, help_w;
+    "-x", Arg.String expand_entry, help_x;
   ] process help
 with ET.Error e -> Printf.eprintf "roles: %s\n%!" (EU.string_of_error e)