let index_empty_texts = ref false let sample_factor = ref 64 let disable_text_collection = ref false let query = ref "" let input_file = ref "" let output_file = ref None let usage_msg = Printf.sprintf "%s 'query' [output]" Sys.argv.(0) let anon_fun = let pos = ref 0 in fun s -> match !pos with | 0 -> input_file:= s;incr pos | 1 -> query := s; incr pos | 2 -> output_file := Some s; incr pos | _ -> raise (Arg.Bad(s)) let spec = [ "-f", Arg.Set_int(sample_factor),"sample factor [default=64]"; "-i", Arg.Set(index_empty_texts),"index empty texts [default=false]"; "-d", Arg.Set(disable_text_collection),"Disable text collection[default=false]"; ] let parse_cmdline() = Arg.parse spec anon_fun usage_msg