|
@@ -39,17 +39,21 @@ open Core.Std;;
|
|
|
(* The module containing the step runned when the program is
|
|
|
* used without argument *)
|
|
|
|
|
|
-let run () =
|
|
|
-
|
|
|
- (* Obtain data from rc file *)
|
|
|
- let rc_content = File_com.init_rc ~rc:Const.rc_file in
|
|
|
-
|
|
|
- (* Obtain data from tmp file *)
|
|
|
- let tmp_content = Tmp_file.init ~tmp:Const.tmp_file in
|
|
|
-
|
|
|
- (* Execute each item (one by one)in config file *)
|
|
|
- let open Settings_t in (* This prevent warning 40 for ~cmd_list:rc_content.progs *)
|
|
|
- let cmd_to_exec = Exec_cmd.what_next ~cmd_list:rc_content.progs ~tmp:tmp_content in
|
|
|
- Exec_cmd.execute ~tmp:tmp_content cmd_to_exec (* TODO Use display option in rc file *)
|
|
|
- |> (fun a -> ()) (* Return nothing, because launched from oclaunch.ml *)
|
|
|
+let run ~rc:rc_content ~tmp:tmp_content cmd_number () =
|
|
|
+ (* cmd_number is the number of the command the user wants
|
|
|
+ * to execute *)
|
|
|
+ match cmd_number with
|
|
|
+ | None -> begin
|
|
|
+ (* Execute each item (one by one)in config file *)
|
|
|
+ let open Settings_t in (* This prevent warning 40 for ~cmd_list:rc_content.progs *)
|
|
|
+ let cmd_to_exec = Exec_cmd.what_next ~cmd_list:rc_content.progs ~tmp:tmp_content in
|
|
|
+ (* TODO Use display option in rc file *)
|
|
|
+ Exec_cmd.execute ~tmp:tmp_content cmd_to_exec;
|
|
|
+ () (* Return nothing, because launched from oclaunch.ml *)
|
|
|
+ end
|
|
|
+ | Some num -> begin
|
|
|
+ let cmd_to_exec = Exec_cmd.num_cmd_to_cmd ~cmd_list:rc_content.progs num in
|
|
|
+ Exec_cmd.execute ~tmp:tmp_content cmd_to_exec;
|
|
|
+ ()
|
|
|
+ end
|
|
|
;;
|