summaryrefslogtreecommitdiff
path: root/toplevel/topdirs.ml
diff options
context:
space:
mode:
authorJérémie Dimino <jeremie@dimino.org>2020-03-16 17:48:41 +0000
committerGitHub <noreply@github.com>2020-03-16 17:48:41 +0000
commite54876a8693a575c5c623a1ee6ae1fef8e347e80 (patch)
tree2d66f38b8756f357d9c627b173281aeafe6f21b5 /toplevel/topdirs.ml
parent58f8284acae7790511a12f9d481def5e0f8e2abb (diff)
downloadocaml-e54876a8693a575c5c623a1ee6ae1fef8e347e80.tar.gz
Add a new toplevel directive #use_output "<command>"
Signed-off-by: Jeremie Dimino <jeremie@dimino.org> Co-authored-by: David Allsopp <david.allsopp@metastack.com>
Diffstat (limited to 'toplevel/topdirs.ml')
-rw-r--r--toplevel/topdirs.ml9
1 files changed, 8 insertions, 1 deletions
diff --git a/toplevel/topdirs.ml b/toplevel/topdirs.ml
index 9510533b4c..20e6912ae6 100644
--- a/toplevel/topdirs.ml
+++ b/toplevel/topdirs.ml
@@ -240,6 +240,7 @@ let load_file = load_file false
(* Load commands from a file *)
let dir_use ppf name = ignore(Toploop.use_file ppf name)
+let dir_use_output ppf name = ignore(Toploop.use_output ppf name)
let dir_mod_use ppf name = ignore(Toploop.mod_use_file ppf name)
let _ = add_directive "use" (Directive_string (dir_use std_out))
@@ -248,6 +249,13 @@ let _ = add_directive "use" (Directive_string (dir_use std_out))
doc = "Read, compile and execute source phrases from the given file.";
}
+let _ = add_directive "use_output" (Directive_string (dir_use_output std_out))
+ {
+ section = section_run;
+ doc = "Execute a command and read, compile and execute source phrases \
+ from its output.";
+ }
+
let _ = add_directive "mod_use" (Directive_string (dir_mod_use std_out))
{
section = section_run;
@@ -255,7 +263,6 @@ let _ = add_directive "mod_use" (Directive_string (dir_mod_use std_out))
wraps the contents in a module.";
}
-
(* Install, remove a printer *)
let filter_arrow ty =