6 module Cxx
= Gen.Make
(Gen_cxx
)
7 module Caml
= Gen.Make
(Gen_caml
)
9 let generate = ref Cxx.process
14 | "cxx" -> Cxx.process
15 | "caml" -> Caml.process
16 | _
-> failwith
(sprintf
"Unknown output language: %s" s
)
19 let f s
= s
>> Main.parse_sql
>> !generate in
21 | "-" -> f (Std.input_all stdin
)
22 | filename
-> Main.with_file filename
f
25 let s1 = sprintf
"SQL Guided (code) Generator ver. %s\n" Config.version
in
26 let s2 = sprintf
"Usage: %s <options> <file.sql>\n" (Filename.basename
Sys.executable_name
) in
27 let s3 = "Options are:" in
30 let show_version () = print_endline
Config.version
35 "-version", Arg.Unit
show_version, " Show version";
36 "-gen", Arg.String
set_out, "cxx|caml Set output language";
37 "-test", Arg.Unit
Test.run
, " Run unit tests";
40 Arg.parse
(Arg.align
args) work usage_msg
42 let _ = Printexc.print
main ()