10
1
mirror of https://gitlab.com/scemama/qmcchem.git synced 2024-11-07 06:33:38 +01:00
qmcchem/ocaml/qmcchem.ml
2019-07-22 11:51:14 +02:00

40 lines
1.1 KiB
OCaml

let update_command_line () =
let last = Array.length Sys.argv - 1 in
for i=1 to last do
Sys.argv.(i) <- Sys.argv.(i+1)
done;
Sys.argv.(last) <- "--"
let () =
let open Command_line in
begin
set_header_doc (Sys.argv.(0) ^ " - QMC=Chem command");
set_description_doc "Driver for subcommands.";
[
anonymous "COMMAND" Mandatory "[debug|edit|info|md5|result|run|stop]";
anonymous "EZFIO_DIR" Mandatory "EZFIO directory";
]
|> set_specs
end;
let command =
match Command_line.anon_args () with
| command :: ezfio_file :: [] -> command
| _ -> (Command_line.help () ; failwith "Inconsistent command line")
in
update_command_line ();
match command with
| "debug" -> let open Qmcchem_debug in ()
| "edit" -> let open Qmcchem_edit in ()
| "info" -> let open Qmcchem_info in ()
| "md5" -> let open Qmcchem_md5 in ()
| "result" -> let open Qmcchem_result in ()
| "run" -> let open Qmcchem_run in ()
| "stop" -> let open Qmcchem_stop in ()
| _ -> (Command_line.help () ; failwith "Inconsistent command line")