Module Conf.Bit
Configuration bits.
Bundles a cli interface and a configuration file lookup.
Note. For Cmdliner proper support we would likely hide it in Cmdliner terms and let them handle the merge logic. Though that poses a few problems with e.g. configuration error report/recovery. Another problem is the recursion between specifying the configuration file lookup on the cli itself while using it terms themselves. Also lazy absents.
Configuration bits
val with_cli_arg : ?docs:string -> ?docv:string -> string -> doc:string -> absent:'a -> conf:'a B0_serialk_sexp.Sexpq.t -> arg:(Cmdliner.Arg.info -> 'a option Cmdliner.Arg.t) -> 'a twith_cli_arg n ~doc ~docs ~docv ~absent ~conf ~argis a configuration bit named byn.argis used to parse the bit from the cli using an option argument namedndocumented withdocin sectiondocsand metavariabledocv.confis used to lookup the bit value in a configuration dictionary with an optional keyn.absentis used as a default value.
val with_cli : string -> absent:'a -> conf:'a B0_serialk_sexp.Sexpq.t -> cli:'a option Cmdliner.Term.t -> 'a twith_cli n ~absent ~conf ~cliis a configuration bit named byncliis used to get the bit from the cli.confis used to lookup the bit value in a configuration dictionary with an optional keyn.basentis used as a default value.
val cli : 'a t -> 'a option Cmdliner.Term.tcli bis the command line interface forb.
val conf : 'a t -> 'a B0_serialk_sexp.Sexpq.tconf bis the configuration key query forb. If the key is not foundabsentis returned.
val get : 'a t -> 'a option -> (B0_serialk_sexp.Sexp.t * B0_serialk_sexp.Sexpq.path) -> ('a, string) Stdlib.resultget b cli sexpgets the configuration bit fromsexpifcliisNone. If it's not in the configuration thenabsentis returned.
val append : 'a list t -> 'a list option -> (B0_serialk_sexp.Sexp.t * B0_serialk_sexp.Sexpq.path) -> ('a list, string) Stdlib.resultappend b cli sexpgets the configuration bit fromsexpand appends them tocli.