let no_jump = ref false
let verbose = ref false
let text_index_type = ref 0
+let do_perf = ref false
+
+(* Only valid if compiled with -DTRACE *)
+let trace_file = ref "trace.dot"
+
let set_index_type = function
| "default" -> text_index_type := 0
"-nj", Arg.Set(no_jump), " disable jumping";
+ "-p", Arg.Set(do_perf), " dump perf counters (Linux only)";
+
"-index-type", Arg.Symbol ([ "default"; "swcsa"; "rlcsa" ],
set_index_type),
" choose text index type";
- "-v", Arg.Set(verbose), " verbose mode";
- ]
+ "-v", Arg.Set(verbose), " verbose mode"; ] @
+IFDEF TRACE
+THEN [
+ "-trace-file", Arg.Set_string(trace_file),
+ "<trace_file> save the full trace in dot format in <trace_file>"
+ ]
+ELSE []
+END
+
let parse_cmdline() =
let _ = Arg.parse spec anon_fun usage_msg