module Driver:sig
..end
Driver
uses the Assemblage_driver.Lib_prefs
and Assemblage_driver.Loader
modules transparently
to initialize a driver. See an example.
typeinit =
(Assemblage_driver.Lib_prefs.t * Assemblage_driver.Loader.t) option
val init : ?version_opt:bool ->
?kinds:Assemblage_driver.Loader.kind list ->
docs:string -> unit -> init * unit Cmdliner.Term.t
init ?version_opt ?kinds ~docs
an initialization value
(init,t)
. docs
is the manual section in which the command
line options for initialization are documented. kinds
is the
kinds of loader that should be supported (defaults to all).
version_opt
should be true if the driver supports a
--version
option through Cmdliner
(defaults to false
).
The returned term t
should always be used in all the
Cmdliner
terms that your program may evaluate. It contains
the command line specification for initialization and may
evaluate to an error that happened during initalization that
will be reported by Cmdliner
's
error mechanism.
There are two cases to consider:
init
is None
. In that case the driver should assume the
contents of Assemblage.Private.Project.list
is meaningless
and simply create its terms using t
. The evaluation of
these term will error either because of t
or because
of a command line parse error.init
is Some (prefs, loader)
. In that case library
preferences are already setup according to prefs
and
assemble files are already loaded according to loader
. The
Assemblage.Private.Project.list
contains the project that
were registered by the assemble files. The driver can now
consult the configuration of these project for example to
specify configuration options for them on the command line
with the Assemblage_driver.Conf_spec
module. Eventually this should lead
Cmdliner
term evaluations by the driver that must include
t
(so that the initalization options are correctly
parsed).val man_vars : ?kinds:Assemblage_driver.Loader.kind list ->
unit -> Cmdliner.Manpage.block list
man_vars kinds
is a man page fragment for the environment
variables used by Assemblage_driver.Driver.init
.This simple example shows how to output the version of a project as it could be configured on the command line.
FIXME.
let main () = ()