Commits

Anonymous committed a49f54c

msg: no input file

  • Participants
  • Parent commits 5fd1ee3

Comments (0)

Files changed (1)

 open Parser
 
 let main =
-  let ch = open_in Sys.argv.(1) in
+  let ch =
+    try open_in Sys.argv.(1) with
+    | Invalid_argument _ -> prerr_endline "minruby: no input file"; exit 1
+  in
   let tstream = Lexer.lexer (Stream.of_channel ch) in
   let rec read_iter store =
     try read_iter (Stream.next tstream :: store) with