X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fmatita%2Fcontribs%2Flambdadelta%2Fbin%2Froles%2Froles.ml;fp=matita%2Fmatita%2Fcontribs%2Flambdadelta%2Fbin%2Froles%2Froles.ml;h=1c7866e47f9c148a1cd4a615a7ea0a4aa4bcc0a5;hb=a1ae862976f2489107dd107937f5e05d0aaa7144;hp=0000000000000000000000000000000000000000;hpb=076439def28e649ec384fae038ed021dadd5f75c;p=helm.git diff --git a/matita/matita/contribs/lambdadelta/bin/roles/roles.ml b/matita/matita/contribs/lambdadelta/bin/roles/roles.ml new file mode 100644 index 000000000..1c7866e47 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/bin/roles/roles.ml @@ -0,0 +1,47 @@ +(* + ||M|| This file is part of HELM, an Hypertextual, Electronic + ||A|| Library of Mathematics, developed at the Computer Science + ||T|| Department, University of Bologna, Italy. + ||I|| + ||T|| HELM is free software; you can redistribute it and/or + ||A|| modify it under the terms of the GNU General Public License + \ / version 2 or (at your option) any later version. + \ / This software is distributed as is, NO WARRANTY. + V_______________________________________________________________ *) + +module EE = RolesEngine +module EG = RolesGlobal +module ET = RolesTypes +module EU = RolesUtils + +let help_C = " Set this working directory (default: current directory)" +let help_L = " Debug osn lexer" +let help_X = " Reset all options to defaults" +let help_r = " Load current status" +let help_s = " Start a stage with this version" +let help_t = " Toggle the selection of this pointed entry" +let help_w = " Save current status" +let help = "Usage: roles [ -LXrw | -C | -s | -t | ]*" + +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 process s = + match Filename.extension s with + | ".txt" -> EE.read_waiting s + | x -> EU.raise_error (ET.EExt x) + +let _main = try + Arg.parse [ + "-C", Arg.String ((:=) EG.wd), help_C; + "-L", Arg.Set EG.debug_lexer, help_L; + "-X", Arg.Unit EG.clear, help_X; + "-r", Arg.Unit EE.read_status, help_r; + "-s", Arg.String new_stage, help_s; + "-t", Arg.String toggle_entry, help_t; + "-w", Arg.Unit EE.write_status, help_w; + ] process help +with ET.Error e -> Printf.eprintf "roles: %s\n%!" (EU.string_of_error e)