1 let index_empty_texts = ref false
2 let sample_factor = ref 64
3 let disable_text_collection = ref false
6 let input_file = ref ""
7 let output_file = ref None
10 let usage_msg = Printf.sprintf "%s <input.xml> 'query' [output]" Sys.argv.(0)
12 let anon_fun = let pos = ref 0 in
13 fun s -> match !pos with
14 | 0 -> input_file:= s;incr pos
15 | 1 -> query := s; incr pos
16 | 2 -> output_file := Some s; incr pos
17 | _ -> raise (Arg.Bad(s))
19 let spec = [ "-f", Arg.Set_int(sample_factor),"sample factor [default=64]";
20 "-i", Arg.Set(index_empty_texts),"index empty texts [default=false]";
21 "-d", Arg.Set(disable_text_collection),"Disable text collection[default=false]"; ]
23 let parse_cmdline() = Arg.parse spec anon_fun usage_msg