X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=src%2Foptions.ml;h=c303c8000dfc6bfb9d94ca0e84e14c5d38ca7b24;hp=b8c5730ab4380b9b7443c6d4d323afc7efc360b4;hb=84751fead39221a8e01d20a4692faf0b63a7c996;hpb=b73ad7605777c49c65673e34f6f9ee635053db13 diff --git a/src/options.ml b/src/options.ml index b8c5730..c303c80 100644 --- a/src/options.ml +++ b/src/options.ml @@ -7,30 +7,38 @@ let queries = ref [] let stats = ref false let compose = ref false let parallel = ref false +let supported_models = [ "naive", (module Naive_tree : Tree.S); + "compact",(module Compact_tree : Tree.S); + ] +let tree_model = ref (fst (List.hd supported_models)) +let set_model s = tree_model := s let set_string_option r s = r := Some s let specs = align [ "-c", Set count, - " write the number of results only"; + " write the number of results only"; "--count", Set count, " "; "-s", Set stats, - " display timing and various statistics"; + " display timing and various statistics"; "--stats", Set stats, " "; "-d", String (set_string_option input_file), - " specify the input document file [default stdin]"; + " specify the input document file [default stdin]"; "--doc", String (set_string_option input_file), " "; "-o", String (set_string_option output_file), - " specify the output file [default stdout]"; + " specify the output file [default stdout]"; "--out", String (set_string_option output_file), " "; "-C", Set compose, - " compose queries: each query is applied to the results of the \ + " compose queries: each query is applied to the results of the \ previous one [default run all queries from the root node]"; "--compose", Set compose, " "; "-p", Set parallel, - " run all queries in parallel [default run all queries \ + " run all queries in parallel [default run all queries \ sequentially]"; "--parallel", Set parallel, " "; + "-m", Symbol (List.map fst supported_models, set_model), + " specify tree model (naive or compact, default to naive)"; + "--model", Symbol (List.map fst supported_models, set_model), " "; ] let usage_msg =