Browse Source

Add warning when the number is out of range

Leo 10 years ago
parent
commit
ce5ce7db8b
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/exec_cmd.ml

+ 5 - 1
src/exec_cmd.ml

@@ -41,7 +41,11 @@ let num_cmd_to_cmd ~cmd_list number =
   (* Verify that the number is not out of the list *)
   if (List.length cmd_list) < number
   then
-    ""
+      begin
+          (* TODO Make this printing configurable *)
+          printf "Out of range. Do not do anything.";
+          ""
+      end
   else
     begin
       let cmd_to_exec = List.nth cmd_list number in