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_______________________________________________________________ *)
12 module EE = RolesEngine
13 module EG = RolesGlobal
14 module ET = RolesTypes
15 module EU = RolesUtils
17 let help_C = "<dir> Set this working directory (default: current directory)"
18 let help_L = " Debug osn lexer"
19 let help_X = " Reset all options to defaults"
20 let help_a = " Add selected names to a role"
21 let help_o = "<version> Add top objects for this stage"
22 let help_r = " Load current status"
23 let help_s = "<version> Start a stage with this version"
24 let help_t = "<pointer> Toggle the selection of this pointed entry"
25 let help_w = " Save current status"
26 let help = "Usage: roles [ -LXarw | -C <dir> | -os <version> | -t <pointer> | <file> ]*"
29 EE.add_tops (EU.version_of_string s)
32 EE.new_stage (EU.version_of_string s)
35 EE.toggle_entry (EU.pointer_of_string s)
38 match Filename.extension s with
39 | ".txt" -> EE.read_waiting s
40 | x -> EU.raise_error (ET.EWrongExt x)
44 "-C", Arg.String ((:=) EG.wd), help_C;
45 "-L", Arg.Set EG.debug_lexer, help_L;
46 "-X", Arg.Unit EG.clear, help_X;
47 "-a", Arg.Unit EE.add_role, help_a;
48 "-o", Arg.String add_tops, help_o;
49 "-r", Arg.Unit EE.read_status, help_r;
50 "-s", Arg.String new_stage, help_s;
51 "-t", Arg.String toggle_entry, help_t;
52 "-w", Arg.Unit EE.write_status, help_w;
54 with ET.Error e -> Printf.eprintf "roles: %s\n%!" (EU.string_of_error e)