4 let input_file = ref ""
5 let output_file : string option ref = ref None
11 "--count", Set count, " write the number of results only";
13 "--stats", Set stats, " display timing and various statistics";
16 let usage_msg = Printf.sprintf "usage: %s [options] input.xml query [output.xml]" Sys.argv.(0)
18 let get_anon, anon_arg =
21 (fun s -> args := s::!args)
23 let usage () = usage specs usage_msg
26 parse specs anon_arg usage_msg;
27 match List.rev (get_anon ()) with
28 input :: q :: maybe_output ->
32 match maybe_output with
34 | [ output ] -> output_file := Some output
35 | _ -> raise (Arg.Bad "too many arguments")
37 | [] | [ _ ] -> raise (Arg.Bad "not enough arguments")