Get rid of the -ocamlc arg altogether

This commit is contained in:
Rudi Grinberg 2018-04-12 18:05:40 +07:00
parent 86e4df847b
commit 75bc824f97
1 changed files with 5 additions and 12 deletions

View File

@ -422,22 +422,15 @@ let main ?(args=[]) ~name f =
let ocamlc = ref (
match Sys.getenv "DUNE_CONFIGURATOR" with
| s -> Some s
| exception Not_found -> None) in
| exception Not_found ->
die "Configurator scripts must be ran with jbuilder. \
To manually run a script, use $ jbuilder exec."
) in
let verbose = ref false in
let dest_dir = ref None in
let args =
Arg.align
([ "-ocamlc", Arg.String (fun s ->
Option.iter !ocamlc ~f:(fun _ ->
Format.eprintf
"ocamlc is already passed through DUNE_CONFIGURATOR. \
There's no need to pass it manually through -ocamlc.@."
);
ocamlc := Some s
),
"PATH ocamlc command to use. \
This value is set automatically when configurator is invoked by dune."
; "-verbose", Arg.Set verbose,
([ "-verbose", Arg.Set verbose,
" be verbose"
; "-dest-dir", Arg.String (fun s -> dest_dir := Some s),
"DIR save temporary files to this directory"