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
18 let help_B = "<url> Set this base url (default: http://helm.cs.unibo.it/lambdadelta/)"
19 let help_C = "<dir> Set this relative working directory (default: invocation directory)"
20 let help_L = " Debug osn lexer"
21 let help_W = " Run as an LWS application"
22 let help_X = " Reset all options to defaults"
23 let help_a = " Add selected names to a role"
24 let help_m = " Add roles relating matching names"
25 let help_o = "<version> Add top objects for this stage"
26 let help_p = " Print current status on standard output"
27 let help_r = " Load current status"
28 let help_s = "<version> Start a stage with this version"
29 let help_t = "<pointer> Toggle the selection of this pointed entry"
30 let help_w = " Save current status"
31 let help = "Usage: roles [ -LWXamprw | -B <url> | -C <dir> | -os <version> | -t <pointer> | <file> ]*"
34 EG.cwd := Filename.concat !EG.cwd s
37 EE.add_tops (EU.version_of_string s)
40 EE.new_stage (EU.version_of_string s)
43 EE.toggle_entry (EU.pointer_of_string s)
46 match Filename.extension s with
47 | ".txt" -> EE.read_waiting s
48 | x -> EU.raise_error (ET.EWrongExt x)
52 "-B", Arg.String ((:=) EG.base_url), help_B;
53 "-C", Arg.String change_cwd, help_C;
54 "-L", Arg.Set EG.debug_lexer, help_L;
55 "-W", Arg.Unit WE.init, help_W;
56 "-X", Arg.Unit EG.clear, help_X;
57 "-a", Arg.Unit EE.add_role, help_a;
58 "-m", Arg.Unit EE.add_matching, help_m;
59 "-o", Arg.String add_tops, help_o;
60 "-p", Arg.Unit EE.print_status, help_p;
61 "-r", Arg.Unit EE.read_status, help_r;
62 "-s", Arg.String new_stage, help_s;
63 "-t", Arg.String toggle_entry, help_t;
64 "-w", Arg.Unit EE.write_status, help_w;
66 with ET.Error e -> Printf.eprintf "roles: %s\n%!" (EU.string_of_error e)