let load_exn ?(and_apply=true) ?profile how =
let conf =
match how with
| `Override c -> c
| `From_path path ->
File.(load_exn path |> pick_profile_exn ?name:profile)
| `In_directory root ->
File.(get_path ~root () |> load_exn |> pick_profile_exn ?name:profile)
| `Guess ->
File.(get_path () |> load_exn |> pick_profile_exn ?name:profile)
in
if and_apply then (
apply_globals conf;
Ketrew_plugin.load_plugins_no_lwt_exn conf.plugins
);
conf