From 69162843cf3b5d026ca6473876aa85085d504222 Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Mon, 19 Sep 2005 12:41:43 +0000 Subject: [PATCH] splitted command line arguments among debugging and non-debugging so that when BuildTimeConf.debug is false the -debug flag is not available --- helm/matita/matitacLib.ml | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/helm/matita/matitacLib.ml b/helm/matita/matitacLib.ml index f7855ac8c..308dd95d2 100644 --- a/helm/matita/matitacLib.ml +++ b/helm/matita/matitacLib.ml @@ -27,28 +27,34 @@ open Printf open MatitaTypes - (** If set to true matitac wont catch top level exception, so that backtrace - * could be inspected setting OCAMLRUNPARAM=b. - * This flag could be enabled passing -debug *) -let debug = ref false - (** {2 Initialization} *) + (** If set to true matitac wont catch top level exception, so that backtrace + * could be inspected setting OCAMLRUNPARAM=b. This flag is enabled passing + * -debug *) +let debug = ref false let paths_to_search_in = ref [];; let quiet_compilation = ref false;; let dont_delete_baseuri = ref false;; let add_l l = fun s -> l := s :: !l ;; -let arg_spec = [ - "-I", Arg.String (add_l paths_to_search_in), - " Adds path to the list of searched paths for the include command"; - "-q", Arg.Set quiet_compilation, "Turn off verbose compilation"; - "-preserve", Arg.Set dont_delete_baseuri, - "Turns off automatic baseuri cleaning"; - "-debug", Arg.Set debug, - "Do not catch top-level exception (useful for backtrace inspection)"; -] +let arg_spec = + let std_arg_spec = [ + "-I", Arg.String (add_l paths_to_search_in), + " Adds path to the list of searched paths for the include command"; + "-q", Arg.Set quiet_compilation, "Turn off verbose compilation"; + "-preserve", Arg.Set dont_delete_baseuri, + "Turns off automatic baseuri cleaning"; + ] in + let debug_arg_spec = + if BuildTimeConf.debug then + [ "-debug", Arg.Set debug, + "Do not catch top-level exception (useful for backtrace inspection)"; ] + else [] + in + std_arg_spec @ debug_arg_spec + let usage = sprintf "MatitaC v%s\nUsage: matitac [option ...] file\nOptions:" BuildTimeConf.version -- 2.39.2