mirror of
https://gitlab.com/scemama/qmcchem.git
synced 2025-01-03 01:55:39 +01:00
Removed core
This commit is contained in:
parent
b14fe1dc34
commit
5e25738f53
@ -12,12 +12,22 @@ type description = {
|
|||||||
arg : argument ;
|
arg : argument ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(* Mutable variables *)
|
||||||
let anon_args = ref []
|
let anon_args = ref []
|
||||||
and header_doc = ref ""
|
and header_doc = ref ""
|
||||||
and description_doc = ref ""
|
and description_doc = ref ""
|
||||||
and footer_doc = ref ""
|
and footer_doc = ref ""
|
||||||
and specs = ref []
|
and specs = ref []
|
||||||
|
|
||||||
|
let reset () =
|
||||||
|
anon_args := [];
|
||||||
|
header_doc := "";
|
||||||
|
description_doc := "";
|
||||||
|
footer_doc := "";
|
||||||
|
specs := []
|
||||||
|
|
||||||
|
(* End mutable variables *)
|
||||||
|
|
||||||
let set_header_doc s = header_doc := s
|
let set_header_doc s = header_doc := s
|
||||||
let set_description_doc s = description_doc := s
|
let set_description_doc s = description_doc := s
|
||||||
let set_footer_doc s = footer_doc := s
|
let set_footer_doc s = footer_doc := s
|
||||||
|
@ -124,3 +124,6 @@ val set_specs : description list -> unit
|
|||||||
val anon_args : unit -> string list
|
val anon_args : unit -> string list
|
||||||
|
|
||||||
|
|
||||||
|
(** Reset the internal state *)
|
||||||
|
val reset : unit -> unit
|
||||||
|
|
||||||
|
@ -24,6 +24,8 @@ ALL_EXE=$(patsubst %.ml,%.native,$(wildcard qp_*.ml)) qmcchem.native
|
|||||||
|
|
||||||
|
|
||||||
default: $(ALL_EXE)
|
default: $(ALL_EXE)
|
||||||
|
mv qmcchem.native $(QMCCHEM_PATH)/bin/qmcchem
|
||||||
|
|
||||||
tests: $(ALL_TESTS)
|
tests: $(ALL_TESTS)
|
||||||
|
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ let run ~t ezfio_filename=
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
let () =
|
let command () =
|
||||||
let open Command_line in
|
let open Command_line in
|
||||||
begin
|
begin
|
||||||
set_header_doc (Sys.argv.(0) ^ " - QMC=Chem command");
|
set_header_doc (Sys.argv.(0) ^ " - QMC=Chem command");
|
||||||
|
@ -274,7 +274,7 @@ let run ~c ?f ?t ?l ?m ?e ?et ?s ?ts ?w ?wt ?n ?j ?p ?input ezfio_filename =
|
|||||||
write_input_in_ezfio ezfio_filename fields
|
write_input_in_ezfio ezfio_filename fields
|
||||||
|
|
||||||
|
|
||||||
let () =
|
let command () =
|
||||||
let open Command_line in
|
let open Command_line in
|
||||||
begin
|
begin
|
||||||
set_header_doc (Sys.argv.(0) ^ " - QMC=Chem command");
|
set_header_doc (Sys.argv.(0) ^ " - QMC=Chem command");
|
||||||
|
@ -12,7 +12,7 @@ let run ezfio_filename =
|
|||||||
ignore @@
|
ignore @@
|
||||||
Unix.execv prog argv
|
Unix.execv prog argv
|
||||||
|
|
||||||
let () =
|
let command () =
|
||||||
let open Command_line in
|
let open Command_line in
|
||||||
begin
|
begin
|
||||||
set_header_doc (Sys.argv.(0) ^ " - QMC=Chem command");
|
set_header_doc (Sys.argv.(0) ^ " - QMC=Chem command");
|
||||||
|
@ -120,7 +120,7 @@ let run ?c ?d ~l ~update ezfio_filename =
|
|||||||
| _ -> handle_options ()
|
| _ -> handle_options ()
|
||||||
|
|
||||||
|
|
||||||
let () =
|
let command () =
|
||||||
let open Command_line in
|
let open Command_line in
|
||||||
begin
|
begin
|
||||||
set_header_doc (Sys.argv.(0) ^ " - QMC=Chem command");
|
set_header_doc (Sys.argv.(0) ^ " - QMC=Chem command");
|
||||||
|
@ -206,7 +206,7 @@ let run ?a ?c ?e ?h ?t ?p ?rmin ?rmax ezfio_file =
|
|||||||
display_summary ~range
|
display_summary ~range
|
||||||
|
|
||||||
|
|
||||||
let () =
|
let command () =
|
||||||
let open Command_line in
|
let open Command_line in
|
||||||
begin
|
begin
|
||||||
set_header_doc (Sys.argv.(0) ^ " - QMC=Chem command");
|
set_header_doc (Sys.argv.(0) ^ " - QMC=Chem command");
|
||||||
|
@ -192,7 +192,7 @@ let run a d ?q ?s ezfio_filename =
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
let () =
|
let command () =
|
||||||
let open Command_line in
|
let open Command_line in
|
||||||
begin
|
begin
|
||||||
set_header_doc (Sys.argv.(0) ^ " - QMC=Chem command");
|
set_header_doc (Sys.argv.(0) ^ " - QMC=Chem command");
|
||||||
|
@ -3,7 +3,7 @@ let run ezfio_filename =
|
|||||||
Qputils.set_ezfio_filename ezfio_filename;
|
Qputils.set_ezfio_filename ezfio_filename;
|
||||||
Status.write Status.Stopping
|
Status.write Status.Stopping
|
||||||
|
|
||||||
let () =
|
let command () =
|
||||||
let open Command_line in
|
let open Command_line in
|
||||||
begin
|
begin
|
||||||
set_header_doc (Sys.argv.(0) ^ " - QMC=Chem command");
|
set_header_doc (Sys.argv.(0) ^ " - QMC=Chem command");
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
let update_command_line () =
|
let update_command_line () =
|
||||||
let last = Array.length Sys.argv - 1 in
|
let last = (Array.length Sys.argv) - 2 in
|
||||||
|
Sys.argv.(0) <- Sys.argv.(0) ^ " " ^ Sys.argv.(1);
|
||||||
for i=1 to last do
|
for i=1 to last do
|
||||||
Sys.argv.(i) <- Sys.argv.(i+1)
|
Sys.argv.(i) <- Sys.argv.(i+1)
|
||||||
done;
|
done;
|
||||||
Sys.argv.(last) <- "--"
|
Sys.argv.(last+1) <- "--"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let () =
|
let () =
|
||||||
@ -11,29 +13,24 @@ let () =
|
|||||||
begin
|
begin
|
||||||
set_header_doc (Sys.argv.(0) ^ " - QMC=Chem command");
|
set_header_doc (Sys.argv.(0) ^ " - QMC=Chem command");
|
||||||
set_description_doc "Driver for subcommands.";
|
set_description_doc "Driver for subcommands.";
|
||||||
[
|
set_specs []
|
||||||
anonymous "COMMAND" Mandatory "[debug|edit|info|md5|result|run|stop]";
|
|
||||||
anonymous "EZFIO_DIR" Mandatory "EZFIO directory";
|
|
||||||
]
|
|
||||||
|> set_specs
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
let command =
|
if Array.length Sys.argv < 2 then
|
||||||
match Command_line.anon_args () with
|
(Command_line.help (); failwith "Inconsistent command line");
|
||||||
| command :: ezfio_file :: [] -> command
|
|
||||||
| _ -> (Command_line.help () ; failwith "Inconsistent command line")
|
|
||||||
in
|
|
||||||
|
|
||||||
|
let command = Sys.argv.(1) in
|
||||||
update_command_line ();
|
update_command_line ();
|
||||||
|
Command_line.reset ();
|
||||||
|
|
||||||
match command with
|
match command with
|
||||||
| "debug" -> let open Qmcchem_debug in ()
|
| "debug" -> let open Qmcchem_debug in command ()
|
||||||
| "edit" -> let open Qmcchem_edit in ()
|
| "edit" -> let open Qmcchem_edit in command ()
|
||||||
| "info" -> let open Qmcchem_info in ()
|
| "info" -> let open Qmcchem_info in command ()
|
||||||
| "md5" -> let open Qmcchem_md5 in ()
|
| "md5" -> let open Qmcchem_md5 in command ()
|
||||||
| "result" -> let open Qmcchem_result in ()
|
| "result" -> let open Qmcchem_result in command ()
|
||||||
| "run" -> let open Qmcchem_run in ()
|
| "run" -> let open Qmcchem_run in command ()
|
||||||
| "stop" -> let open Qmcchem_stop in ()
|
| "stop" -> let open Qmcchem_stop in command ()
|
||||||
| _ -> (Command_line.help () ; failwith "Inconsistent command line")
|
| _ -> (Command_line.help () ; failwith "Inconsistent command line")
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user