瀏覽代碼

error message for --run
instead of a crash (closes #9513)

Aleksandr Kuzmenko 5 年之前
父節點
當前提交
8bd312a53c
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      src/compiler/haxe.ml

+ 3 - 2
src/compiler/haxe.ml

@@ -765,8 +765,9 @@ try
 			Initialize.set_platform com (!Globals.macro_platform) "";
 			interp := true;
 		),"","interpret the program using internal macro system");
-		("Target",["--run"],[], Arg.Unit (fun() -> die "" __LOC__), "<module> [args...]","interpret a Haxe module with command line arguments");
-
+		("Target",["--run"],[], Arg.Unit (fun() ->
+			raise (Arg.Bad "--run requires an argument: a Haxe module name")
+		), "<module> [args...]","interpret a Haxe module with command line arguments");
 		("Compilation",["-p";"--class-path"],["-cp"],Arg.String (fun path ->
 			process_libs();
 			com.class_path <- Path.add_trailing_slash path :: com.class_path