diff options
author | Enrico Tassi <Enrico.Tassi@inria.fr> | 2017-01-04 14:35:51 +0100 |
---|---|---|
committer | Enrico Tassi <Enrico.Tassi@inria.fr> | 2017-05-23 10:48:28 +0200 |
commit | b2b4e85ec6607d7364a0da9c65ae9303b9f73c03 (patch) | |
tree | 5653b4d5438ddead97fd8c285c772c429a758511 | |
parent | da5ac9169d0c65ff389104dfd983311b85e059e2 (diff) |
Usage.print_config moved to Envars
-rw-r--r-- | lib/envars.ml | 15 | ||||
-rw-r--r-- | lib/envars.mli | 3 | ||||
-rw-r--r-- | tools/coqc.ml | 2 | ||||
-rw-r--r-- | toplevel/coqtop.ml | 2 | ||||
-rw-r--r-- | toplevel/usage.ml | 13 | ||||
-rw-r--r-- | toplevel/usage.mli | 2 |
6 files changed, 20 insertions, 17 deletions
diff --git a/lib/envars.ml b/lib/envars.ml index 89ce52831..330b0fbd6 100644 --- a/lib/envars.ml +++ b/lib/envars.ml @@ -207,3 +207,18 @@ let xdg_config_dirs warn = let xdg_dirs ~warn = List.filter Sys.file_exists (xdg_data_dirs warn) + +(* Print the configuration information *) + +let print_config f = + let open Printf in + fprintf f "LOCAL=%s\n" (if Coq_config.local then "1" else "0"); + fprintf f "COQLIB=%s/\n" (coqlib ()); + fprintf f "DOCDIR=%s/\n" (docdir ()); + fprintf f "OCAMLFIND=%s\n" (ocamlfind ()); + fprintf f "CAMLP4=%s\n" Coq_config.camlp4; + fprintf f "CAMLP4O=%s\n" Coq_config.camlp4o; + fprintf f "CAMLP4BIN=%s/\n" (camlp4bin ()); + fprintf f "CAMLP4LIB=%s\n" (camlp4lib ()); + fprintf f "CAMLP4OPTIONS=%s\n" Coq_config.camlp4compat; + fprintf f "HASNATDYNLINK=%s\n" (if Coq_config.has_natdynlink then "true" else "false") diff --git a/lib/envars.mli b/lib/envars.mli index 90a42859b..b9cc534f9 100644 --- a/lib/envars.mli +++ b/lib/envars.mli @@ -69,3 +69,6 @@ val xdg_data_home : (string -> unit) -> string val xdg_config_dirs : (string -> unit) -> string list val xdg_data_dirs : (string -> unit) -> string list val xdg_dirs : warn : (string -> unit) -> string list + +(** {6 Prints the configuration information } *) +val print_config : out_channel -> unit diff --git a/tools/coqc.ml b/tools/coqc.ml index 552a943c8..e9f79212b 100644 --- a/tools/coqc.ml +++ b/tools/coqc.ml @@ -83,7 +83,7 @@ let parse_args () = | ("-config" | "--config") :: _ -> Envars.set_coqlib ~fail:(fun x -> x); - Usage.print_config (); + Envars.print_config stdout; exit 0 (* Options for coqtop : a) options with 0 argument *) diff --git a/toplevel/coqtop.ml b/toplevel/coqtop.ml index 41d370ea5..4237ef360 100644 --- a/toplevel/coqtop.ml +++ b/toplevel/coqtop.ml @@ -620,7 +620,7 @@ let init_toplevel arglist = Spawned.init_channels (); Envars.set_coqlib ~fail:CErrors.error; if !print_where then (print_endline(Envars.coqlib ()); exit(exitcode ())); - if !print_config then (Usage.print_config (); exit (exitcode ())); + if !print_config then (Envars.print_config stdout; exit (exitcode ())); if !print_tags then (print_style_tags (); exit (exitcode ())); if !filter_opts then (print_string (String.concat "\n" extras); exit 0); init_load_path (); diff --git a/toplevel/usage.ml b/toplevel/usage.ml index e29048035..67701d73e 100644 --- a/toplevel/usage.ml +++ b/toplevel/usage.ml @@ -115,16 +115,3 @@ let print_usage_coqc () = flush stderr ; exit 1 -(* Print the configuration information *) - -let print_config () = - if Coq_config.local then Printf.printf "LOCAL=1\n" else Printf.printf "LOCAL=0\n"; - Printf.printf "COQLIB=%s/\n" (Envars.coqlib ()); - Printf.printf "DOCDIR=%s/\n" (Envars.docdir ()); - Printf.printf "OCAMLFIND=%s\n" (Envars.ocamlfind ()); - Printf.printf "CAMLP4=%s\n" Coq_config.camlp4; - Printf.printf "CAMLP4O=%s\n" Coq_config.camlp4o; - Printf.printf "CAMLP4BIN=%s/\n" (Envars.camlp4bin ()); - Printf.printf "CAMLP4LIB=%s\n" (Envars.camlp4lib ()); - Printf.printf "CAMLP4OPTIONS=%s\n" Coq_config.camlp4compat; - Printf.printf "HASNATDYNLINK=%s\n" (if Coq_config.has_natdynlink then "true" else "false") diff --git a/toplevel/usage.mli b/toplevel/usage.mli index dccb40e71..c46c7a79c 100644 --- a/toplevel/usage.mli +++ b/toplevel/usage.mli @@ -21,5 +21,3 @@ val add_to_usage : string -> string -> unit val print_usage_coqtop : unit -> unit val print_usage_coqc : unit -> unit -(** {6 Prints the configuration information } *) -val print_config : unit -> unit |