install_admin_subcommand ~component_name ~subcommand_name ~fl ~ctx_t
defines a subcommand that should be added to dkml-install-runner.exe that, when invoked, will install the component with privileged administrator (`root` or `sudo` on Unix) permissions.
~component_name
: This will correspond to the component name defined in the full Component_config
module type.
~subcommand_name
: Typically but not always the subcommand name is "install-admin-" ^ component_name
.
~fl
: A fatal logger used whenver there is an error requiring the process to exit.
~ctx_t
: A Cmdliner term that sets up common options and delivers a context record. The common options include options for logging. The context record is described at Dkml_install_api
.
You must include the ctx_t
term in your returned Term.t * Term.info
, as in:
let execute_install_admin ctx =
Format.printf
"We can run bytecode using: %s@\n"
(ctx.Dkml_install_api.Context.path_eval "%{ocamlrun:share-abi}/bin/ocamlrun")
let install_admin_subcommand ~component_name ~subcommand_name ~ctx_t =
let doc = "Install the pieces requiring Administrative rights" in
Dkml_install_api.Forward_progress.Continue_progress (Cmdliner.Term.(const execute_install_admin $ ctx_t, info subcommand_name ~doc), fl)
Your Term.t
function (execute_install_admin ctx
) should raise Installation_error
for any unrecoverable failures.