1 module EC = RecommCheck
2 module EL = RecommLexer
3 module EI = RecommInput
4 module EO = RecommOutput
6 module P1 = RecommPccFor
7 module P2 = RecommPcsAnd
8 module P3 = RecommPcsPar
19 let rec process path name =
20 let file = Filename.concat path name in
21 if Sys.is_directory file then begin
22 let dir = Sys.readdir file in
23 Array.iter (process file) dir
25 if Filename.extension file = ".ma" then begin
26 Printf.eprintf "processing: %S\n" file;
27 let orig = EI.read_srcs file in
28 let lint = EC.recomm_srcs orig in
29 if !force || (!write && lint <> orig) then EO.write_srcs file lint
31 Printf.eprintf "skipping: %S\n" file
34 let msg_C = "<dir> Set this working directory (default: .)"
35 let msg_L = " Log lexer tokens (default: no)"
36 let msg_c = "<int> Set these output columns (default: 78)"
37 let msg_d = " Log with dark colors (default: no)"
38 let msg_f = " Write all output files (default: no)"
39 let msg_k = " Log key comments (default: no)"
40 let msg_m = " Log mark comments (default: no)"
41 let msg_n = " Log with no colors (default: yes)"
42 let msg_o = " Log other comments (default: no)"
43 let msg_r = " Replace the input files (default: no)"
44 let msg_s = " Log section comments (default: no)"
45 let msg_t = " Log title comments (default: no)"
46 let msg_w = " Write the changed output files (default: no)"
50 "-C", Arg.String chdir, msg_C;
51 "-L", Arg.Set EL.debug, msg_m;
52 "-c", Arg.Int ((:=) EO.width), msg_c;
53 "-d", Arg.Clear EC.bw, msg_d;
54 "-f", Arg.Set force, msg_f;
55 "-k", Arg.Set EC.log_k, msg_k;
56 "-m", Arg.Set EC.log_m, msg_m;
57 "-n", Arg.Set EC.bw, msg_n;
58 "-o", Arg.Set EC.log_o, msg_o;
59 "-r", Arg.Set EO.replace, msg_r;
60 "-s", Arg.Set EC.log_s, msg_s;
61 "-t", Arg.Set EC.log_t, msg_t;
62 "-w", Arg.Set write, msg_w;