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