let twopass = ref false
let repeat = ref 1
let docstats = ref false
+let no_wrap_results = ref false
let set_index_type = function
| "default" -> text_index_type := 0
"-nc", Arg.Set(no_cache), " disable caching";
+ "-nw", Arg.Set(no_wrap_results), " do not wrap results in <xml_results/>";
"-p", Arg.Set(do_perf), " dump perf counters (Linux only)";
"-doc-stats", Arg.Set(docstats),
" Compute document statistics (performs full traversal)";
-
"-v", Arg.Set(verbose), " verbose mode"; ] @
IFNDEF NTRACE
THEN [
ELSE []
END
+let real_spec =
+ spec @ [
+ "-", Arg.Unit (fun () -> anon_fun "-"), "";
+ ]
+
let parse_cmdline() =
- let _ = Arg.parse spec anon_fun usage_msg
+ let _ =
+ try
+ Arg.parse_argv Sys.argv real_spec anon_fun usage_msg;
+ if (!pos > 3 || !pos < 2) then raise (Arg.Bad "Invalid number of arguments")
+ with
+ Arg.Bad s | Arg.Help s ->
+ eprintf "%s\n" (Arg.usage_string spec usage_msg);
+ exit 1
in
- if (!pos > 3 || !pos < 2)
- then begin Arg.usage spec usage_msg; exit 1 end
+ Logger.set_verbose !verbose