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")