4 let input_file : string option ref = ref None
5 let output_file : string option ref = ref None
9 let set_string_option r s = r := Some s
12 "-c", Set count, " write the number of results only";
13 "--count", Set count, " ";
14 "-s", Set stats, " display timing and various statistics";
15 "--stats", Set stats, " ";
16 "-d", String (set_string_option input_file), " specify the input document file [default stdin]";
17 "--doc", String (set_string_option input_file), " ";
18 "-o", String (set_string_option output_file), " specify the output file [default stdout]";
19 "--out", String (set_string_option output_file), " ";
22 let usage_msg = Printf.sprintf "usage: %s [options] query" Sys.argv.(0)
24 let usage () = usage specs usage_msg
27 parse specs (fun q -> query := q) usage_msg