summaryrefslogtreecommitdiff
path: root/toplevel/opttoploop.mli
diff options
context:
space:
mode:
authorJeremie Dimino <jdimino@janestreet.com>2016-02-24 17:23:21 +0000
committerJeremie Dimino <jdimino@janestreet.com>2016-03-01 10:36:24 +0000
commit86daba0e9093cdff18e75555e05f5fbe44ea7722 (patch)
treea9322f580dd81a589a406634d305ee557a0c48f6 /toplevel/opttoploop.mli
parentb98461c3f35a3d046940d06054eef874769ee8d7 (diff)
downloadocaml-86daba0e9093cdff18e75555e05f5fbe44ea7722.tar.gz
Add Toploop.override_sys_argv
Diffstat (limited to 'toplevel/opttoploop.mli')
-rw-r--r--toplevel/opttoploop.mli10
1 files changed, 10 insertions, 0 deletions
diff --git a/toplevel/opttoploop.mli b/toplevel/opttoploop.mli
index 3ce4d19108..f234b4f4cf 100644
--- a/toplevel/opttoploop.mli
+++ b/toplevel/opttoploop.mli
@@ -120,3 +120,13 @@ val read_interactive_input : (string -> bytes -> int -> int * bool) ref
(* Hooks for initialization *)
val toplevel_startup_hook : (unit -> unit) ref
+
+(* Misc *)
+
+val override_sys_argv : string array -> unit
+(* [override_sys_argv args] replaces the contents of [Sys.argv] by [args]
+ and reset [Arg.current] to [0].
+
+ This is called by [run_script] so that [Sys.argv] represents
+ "script.ml args..." instead of the full command line:
+ "ocamlrun unix.cma ... script.ml args...". *)