From 68b32b6d059f05c9b8c2859aa73209a13cbe8994 Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Tue, 20 Oct 2020 21:43:29 +0200 Subject: [PATCH] [dune subst] Interpret common command line flags. In particular I wanted this as to have `dune subst` interpret `--debug-backtraces` in the context of #3219 Signed-off-by: Emilio Jesus Gallego Arias --- CHANGES.md | 3 +++ bin/subst.ml | 11 +++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index d7b55183d0b..c3ecf848b6f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -63,6 +63,9 @@ Unreleased fixes problems with `dune subst` in the presence of unicode files. Fixes #3219 (#3879, @ejgallego) +- `dune subst` now accepts common command-line arguments such as + `--debug-backtraces` (#3878, @ejgallego) + 2.7.1 (2/09/2020) ----------------- diff --git a/bin/subst.ml b/bin/subst.ml index dd473f9adba..edbfedf0f3a 100644 --- a/bin/subst.ml +++ b/bin/subst.ml @@ -58,14 +58,9 @@ let man = let info = Term.info "subst" ~doc ~man let term = - let+ () = Common.build_info in - let config : Config.t = - { Config.default with display = Quiet; concurrency = Fixed 1 } - in - Path.set_root (Path.External.cwd ()); - Path.Build.set_build_dir (Path.Build.Kind.of_string Common.default_build_dir); - Config.init config; - Log.init_disabled (); + let+ common = Common.term in + Common.set_common ~log_file:No_log_file common ~targets:[]; + let config = Common.config common in Dune_engine.Scheduler.go ~config Watermarks.subst let command = (term, info)