瀏覽代碼

User defines/metas: do not display haxe help message when nothing happens (#10885)

Rudy Ges 2 年之前
父節點
當前提交
b158bd1fa9

+ 2 - 0
src/compiler/args.ml

@@ -152,6 +152,7 @@ let parse_args com =
 			actx.did_something <- true
 		),"","print help for all compiler specific defines");
 		("Miscellaneous",["--help-user-defines"],[], Arg.Unit (fun() ->
+			actx.did_something <- true;
 			com.callbacks#add_after_init_macros (fun() ->
 				let all,max_length = Define.get_user_documentation_list com.user_defines in
 				let all = List.map (fun (n,doc) -> Printf.sprintf " %-*s: %s" max_length n (limit_string doc (max_length + 3))) all in
@@ -166,6 +167,7 @@ let parse_args com =
 			actx.did_something <- true
 		),"","print help for all compiler metadatas");
 		("Miscellaneous",["--help-user-metas"],[], Arg.Unit (fun() ->
+			actx.did_something <- true;
 			com.callbacks#add_after_init_macros (fun() ->
 				let all,max_length = Meta.get_user_documentation_list com.user_metas in
 				let all = List.map (fun (n,doc) -> Printf.sprintf " %-*s: %s" max_length n (limit_string doc (max_length + 3))) all in

+ 1 - 0
tests/misc/projects/Issue10844/user-defines-did-something.hxml

@@ -0,0 +1 @@
+--help-user-defines

+ 0 - 0
tests/misc/projects/Issue10844/user-defines-did-something.hxml.stdout


+ 1 - 0
tests/misc/projects/Issue10844/user-metas-did-something.hxml

@@ -0,0 +1 @@
+--help-user-metas

+ 0 - 0
tests/misc/projects/Issue10844/user-metas-did-something.hxml.stdout