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_m = " Add roles relating matching names"
22 let help_o = "<version> Add top objects for this stage"
23 let help_p = " Print current status on standard output"
24 let help_r = " Load current status"
25 let help_s = "<version> Start a stage with this version"
26 let help_t = "<pointer> Toggle the selection of this pointed entry"
27 let help_w = " Save current status"
28 let help = "Usage: roles [ -LXamprw | -C <dir> | -os <version> | -t <pointer> | <file> ]*"
31 EE.add_tops (EU.version_of_string s)
34 EE.new_stage (EU.version_of_string s)
37 EE.toggle_entry (EU.pointer_of_string s)
40 match Filename.extension s with
41 | ".txt" -> EE.read_waiting s
42 | x -> EU.raise_error (ET.EWrongExt x)
46 "-C", Arg.String ((:=) EG.wd), help_C;
47 "-L", Arg.Set EG.debug_lexer, help_L;
48 "-X", Arg.Unit EG.clear, help_X;
49 "-a", Arg.Unit EE.add_role, help_a;
50 "-m", Arg.Unit EE.add_matching, help_m;
51 "-o", Arg.String add_tops, help_o;
52 "-p", Arg.Unit EE.print_status, help_p;
53 "-r", Arg.Unit EE.read_status, help_r;
54 "-s", Arg.String new_stage, help_s;
55 "-t", Arg.String toggle_entry, help_t;
56 "-w", Arg.Unit EE.write_status, help_w;
58 with ET.Error e -> Printf.eprintf "roles: %s\n%!" (EU.string_of_error e)