aboutsummaryrefslogtreecommitdiff
path: root/sysinit
diff options
context:
space:
mode:
Diffstat (limited to 'sysinit')
-rw-r--r--sysinit/coqargs.ml22
-rw-r--r--sysinit/usage.ml5
2 files changed, 13 insertions, 14 deletions
diff --git a/sysinit/coqargs.ml b/sysinit/coqargs.ml
index 56d88e6bd6..8be73ca028 100644
--- a/sysinit/coqargs.ml
+++ b/sysinit/coqargs.ml
@@ -22,14 +22,6 @@ let error_missing_arg s =
exit 1
(******************************************************************************)
-(* Imperative effects! This must be fixed at some point. *)
-(******************************************************************************)
-
-let set_debug () =
- let () = Exninfo.record_backtrace true in
- Flags.debug := true
-
-(******************************************************************************)
type native_compiler = Coq_config.native_compiler =
NativeOff | NativeOn of { ondemand : bool }
@@ -168,6 +160,9 @@ let add_load_vernacular opts verb s =
let add_set_option opts opt_name value =
{ opts with pre = { opts.pre with injections = OptionInjection (opt_name, value) :: opts.pre.injections }}
+let add_set_debug opts flags =
+ add_set_option opts ["Debug"] (OptionAppend flags)
+
(** Options for proof general *)
let set_emacs opts =
let opts = add_set_option opts Printer.print_goal_tag_opt_name (OptionSet None) in
@@ -382,10 +377,15 @@ let parse_args ~usage ~init arglist : t * string list =
(* Options with zero arg *)
|"-test-mode" -> Vernacinterp.test_mode := true; oval
|"-beautify" -> Flags.beautify := true; oval
- |"-bt" -> Exninfo.record_backtrace true; oval
+ |"-bt" -> add_set_debug oval "backtrace"
|"-config"|"--config" -> set_query oval PrintConfig
- |"-debug" -> set_debug (); oval
- |"-xml-debug" -> Flags.xml_debug := true; set_debug (); oval
+
+ |"-debug" -> add_set_debug oval "all"
+ |"-d" | "-D" -> add_set_debug oval (next())
+
+ (* -xml-debug implies -debug. TODO don't be imperative here. *)
+ |"-xml-debug" -> Flags.xml_debug := true; add_set_debug oval "all"
+
|"-diffs" ->
add_set_option oval Proof_diffs.opt_name @@ OptionSet (Some (next ()))
|"-emacs" -> set_emacs oval
diff --git a/sysinit/usage.ml b/sysinit/usage.ml
index 763cd54137..d00b916f23 100644
--- a/sysinit/usage.ml
+++ b/sysinit/usage.ml
@@ -9,9 +9,8 @@
(************************************************************************)
let version () =
- Printf.printf "The Coq Proof Assistant, version %s (%s)\n"
- Coq_config.version Coq_config.date;
- Printf.printf "compiled on %s with OCaml %s\n" Coq_config.compile_date Coq_config.caml_version
+ Printf.printf "The Coq Proof Assistant, version %s\n" Coq_config.version;
+ Printf.printf "compiled with OCaml %s\n" Coq_config.caml_version
let machine_readable_version () =
Printf.printf "%s %s\n"