+let _ =
+ HelmLogger.register_log_callback
+ (fun ?(append_NL = true) msg ->
+ (if append_NL then prerr_endline else prerr_string)
+ (HelmLogger.string_of_html_msg msg));
+ let names = ref [] in
+ let tryvars = ref false in
+ let typecheck = ref false in
+ let prefix = ref "" in
+ let varsprefix = ref "####" in
+ let usage = "testlibrary [OPTION] ... (uri1 | file1) (uri2 | file2) ..." in
+ let spec =
+ [ "-vars", Arg.Set tryvars, "try also variables" ;
+ "-novars", Arg.Clear tryvars, "do not try variables (default)" ;
+ "-prefix", Arg.Set_string prefix,
+ "limit object choices to URIs beginning with prefix" ;
+ "-varsprefix", Arg.Set_string varsprefix,
+ "limit variable choices to URIs beginning with prefix; overrides -prefix" ;
+ "-timeout", Arg.Set_int time_out,
+ "number of seconds before a timeout; 0 means no timeout";
+ "-typecheck", Arg.Set typecheck, "simply typechek the uri"
+ ]
+ in
+ Arg.parse spec (fun name -> names := name :: !names) usage;
+ let names = List.rev !names in
+ if !varsprefix = "####" then varsprefix := !prefix ;
+ uri_predicate :=
+ BatchParser.uri_pred_of_conf !tryvars ~prefix:!prefix ~varsprefix:!varsprefix;
+ let status = (ref [], ref [], ref [], ref []) in (* <ok, nok, maybe, timeout> URIs *)
+ List.iter
+ (fun name ->
+ try
+ let uri = UriManager.uri_of_string name in
+ do_uri !typecheck status uri
+ with UriManager.IllFormedUri _ ->
+ if Sys.file_exists name then
+ do_file !typecheck status name
+ else
+ printf "Don't know what to do with '%s', ignoring it\n%!" name)
+ names ;
+ report status