mirror of
https://github.com/LCPQ/quantum_package
synced 2024-12-23 04:43:50 +01:00
Added -c option in qp_edit to only check input.
This commit is contained in:
parent
3529950720
commit
e37bc2c15f
@ -153,7 +153,7 @@ let create_temp_file ezfio_filename fields =
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
let run ezfio_filename =
|
let run check_only ezfio_filename =
|
||||||
|
|
||||||
(* Open EZFIO *)
|
(* Open EZFIO *)
|
||||||
if (not (Sys.file_exists_exn ezfio_filename)) then
|
if (not (Sys.file_exists_exn ezfio_filename)) then
|
||||||
@ -194,8 +194,13 @@ let run ezfio_filename =
|
|||||||
| Some editor -> editor
|
| Some editor -> editor
|
||||||
| None -> "vi"
|
| None -> "vi"
|
||||||
in
|
in
|
||||||
Printf.sprintf "%s %s" editor temp_filename
|
|
||||||
|> Sys.command_exn ;
|
match check_only with
|
||||||
|
| true -> ()
|
||||||
|
| false ->
|
||||||
|
Printf.sprintf "%s %s" editor temp_filename
|
||||||
|
|> Sys.command_exn
|
||||||
|
;
|
||||||
|
|
||||||
(* Re-read the temp file *)
|
(* Re-read the temp file *)
|
||||||
let temp_string =
|
let temp_string =
|
||||||
@ -231,9 +236,9 @@ let restore_backup ezfio_filename =
|
|||||||
let spec =
|
let spec =
|
||||||
let open Command.Spec in
|
let open Command.Spec in
|
||||||
empty
|
empty
|
||||||
|
+> flag "-c" no_arg
|
||||||
|
~doc:"Checks the input data"
|
||||||
(*
|
(*
|
||||||
+> flag "i" (optional string)
|
|
||||||
~doc:"Prints input data"
|
|
||||||
+> flag "o" (optional string)
|
+> flag "o" (optional string)
|
||||||
~doc:"Prints output data"
|
~doc:"Prints output data"
|
||||||
*)
|
*)
|
||||||
@ -255,9 +260,9 @@ Edit input data
|
|||||||
with
|
with
|
||||||
| _ msg -> print_string ("\n\nError\n\n"^msg^"\n\n")
|
| _ msg -> print_string ("\n\nError\n\n"^msg^"\n\n")
|
||||||
*)
|
*)
|
||||||
(fun ezfio_file () ->
|
(fun c ezfio_file () ->
|
||||||
try
|
try
|
||||||
run ezfio_file ;
|
run c ezfio_file ;
|
||||||
(* create_backup ezfio_file; *)
|
(* create_backup ezfio_file; *)
|
||||||
with
|
with
|
||||||
| Failure exc
|
| Failure exc
|
||||||
|
Loading…
Reference in New Issue
Block a user