|
@@ -1046,6 +1046,37 @@ try
|
|
loop 0;
|
|
loop 0;
|
|
did_something := true
|
|
did_something := true
|
|
),": print help for all compiler specific defines");
|
|
),": print help for all compiler specific defines");
|
|
|
|
+ ("--help-metas", Arg.Unit (fun() ->
|
|
|
|
+ let rec loop i =
|
|
|
|
+ let d = Obj.magic i in
|
|
|
|
+ if d <> Meta.Last then begin
|
|
|
|
+ let t, (doc,flags) = MetaInfo.to_string d in
|
|
|
|
+ let params = ref [] and used = ref [] and pfs = ref [] in
|
|
|
|
+ List.iter (function
|
|
|
|
+ | MetaInfo.HasParam s -> params := s :: !params
|
|
|
|
+ | MetaInfo.Platform f -> pfs := f :: !pfs
|
|
|
|
+ | MetaInfo.Platforms fl -> pfs := fl @ !pfs
|
|
|
|
+ | MetaInfo.UsedOn u -> used := u :: !used
|
|
|
|
+ | MetaInfo.UsedOnEither ul -> used := ul @ !used
|
|
|
|
+ ) flags;
|
|
|
|
+ let params = (match List.rev !params with
|
|
|
|
+ | [] -> ""
|
|
|
|
+ | l -> "(" ^ String.concat "," l ^ ")"
|
|
|
|
+ ) in
|
|
|
|
+ let pfs = (match List.rev !pfs with
|
|
|
|
+ | [] -> ""
|
|
|
|
+ | [p] -> " (" ^ platform_name p ^ " only)"
|
|
|
|
+ | pl -> " (for " ^ String.concat "," (List.map platform_name pl) ^ ")"
|
|
|
|
+ ) in
|
|
|
|
+ let str = "@" ^ t ^ params ^ " : " ^ doc ^ pfs in
|
|
|
|
+ str :: loop (i + 1)
|
|
|
|
+ end else
|
|
|
|
+ []
|
|
|
|
+ in
|
|
|
|
+ let all = List.sort String.compare (loop 0) in
|
|
|
|
+ List.iter (fun msg -> message ctx msg Ast.null_pos) all;
|
|
|
|
+ did_something := true
|
|
|
|
+ ),": print help for all compiler metadatas");
|
|
] in
|
|
] in
|
|
let args_callback cl = classes := make_path cl :: !classes in
|
|
let args_callback cl = classes := make_path cl :: !classes in
|
|
let process args =
|
|
let process args =
|