aboutsummaryrefslogtreecommitdiffhomepage
path: root/ide
diff options
context:
space:
mode:
authorGravatar Enrico Tassi <Enrico.Tassi@inria.fr>2014-01-22 10:27:41 +0100
committerGravatar Enrico Tassi <Enrico.Tassi@inria.fr>2014-01-26 14:20:52 +0100
commit3afdca3562b9dcadd9b16991bd8716f38a55f2c8 (patch)
treec4c8dbb63e8546244b4ff9aa9fc71140d27754b5 /ide
parenta2c200faca4cd20985836f1661e9b2059fd20651 (diff)
CoqIDE: command line for extra coqtop "flags"
Like the socket for the OCaml debugger
Diffstat (limited to 'ide')
-rw-r--r--ide/coq.ml14
-rw-r--r--ide/coqide.ml3
2 files changed, 17 insertions, 0 deletions
diff --git a/ide/coq.ml b/ide/coq.ml
index bb0fdc089..c8ba8549b 100644
--- a/ide/coq.ml
+++ b/ide/coq.ml
@@ -381,6 +381,20 @@ let bind_self_as f =
let spawn_handle args respawner feedback_processor =
let prog = coqtop_path () in
let args = Array.of_list ("-async-proofs" :: "on" :: "-ideslave" :: args) in
+ let env =
+ match !Flags.ideslave_coqtop_flags with
+ | None -> None
+ | Some s ->
+ let open Str in
+ let open Array in
+ let opts = split_delim (regexp ",") s in
+ begin try
+ let erex = regexp "^extra-env=" in
+ let echunk = List.find (fun s -> string_match erex s 0) opts in
+ Some (append
+ (of_list (split_delim (regexp ";") (replace_first erex "" echunk)))
+ (Unix.environment ()))
+ with Not_found -> None end in
bind_self_as (fun handle ->
let proc, oc =
CoqTop.spawn ?env prog args (input_watch handle respawner feedback_processor) in
diff --git a/ide/coqide.ml b/ide/coqide.ml
index 1a6685b38..ab832b4e4 100644
--- a/ide/coqide.ml
+++ b/ide/coqide.ml
@@ -1472,6 +1472,9 @@ let read_coqide_args argv =
Flags.debug := true;
Backtrace.record_backtrace true;
filter_coqtop coqtop project_files ("-debug"::out) args
+ |"-coqtop-flags" :: flags :: args->
+ Flags.ideslave_coqtop_flags := Some flags;
+ filter_coqtop coqtop project_files out args
|arg::args -> filter_coqtop coqtop project_files (arg::out) args
|[] -> (coqtop,List.rev project_files,List.rev out)
in