diff options
author | 2014-01-22 10:27:41 +0100 | |
---|---|---|
committer | 2014-01-26 14:20:52 +0100 | |
commit | 3afdca3562b9dcadd9b16991bd8716f38a55f2c8 (patch) | |
tree | c4c8dbb63e8546244b4ff9aa9fc71140d27754b5 | |
parent | a2c200faca4cd20985836f1661e9b2059fd20651 (diff) |
CoqIDE: command line for extra coqtop "flags"
Like the socket for the OCaml debugger
-rw-r--r-- | ide/coq.ml | 14 | ||||
-rw-r--r-- | ide/coqide.ml | 3 | ||||
-rw-r--r-- | lib/flags.ml | 2 | ||||
-rw-r--r-- | lib/flags.mli | 2 |
4 files changed, 19 insertions, 2 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 diff --git a/lib/flags.ml b/lib/flags.ml index 3a79a83e3..9832ba587 100644 --- a/lib/flags.ml +++ b/lib/flags.ml @@ -67,7 +67,7 @@ let term_quality = ref false let xml_export = ref false let ide_slave = ref false -let ide_slave_socket = ref None +let ideslave_coqtop_flags = ref None let time = ref false diff --git a/lib/flags.mli b/lib/flags.mli index 476b52a7a..ecaa11388 100644 --- a/lib/flags.mli +++ b/lib/flags.mli @@ -30,7 +30,7 @@ val term_quality : bool ref val xml_export : bool ref val ide_slave : bool ref -val ide_slave_socket : (string * int) option ref +val ideslave_coqtop_flags : string option ref val time : bool ref |