package ocamlformat-lib
Module Ocamlformat_lib.Conf_declSource
This module contains ways to declare command-line and config-files options for ocamlformat. To look at declared options, see Conf.mli. To declare a new option :
- Add a field to one of the records in
Conf_t - Declare the option in
Conf, using functions from this module.
Source
type typ = | Int| Bool| Ocaml_version| Choice of Ocamlformat_stdlib.string Ocamlformat_stdlib.list
The type of an option declaration
Source
type 'a declarator =
names:Ocamlformat_stdlib.string Ocamlformat_stdlib.list ->
default:Conf_t.t ->
doc:Ocamlformat_stdlib.string ->
kind:kind ->
?allow_inline:Ocamlformat_stdlib.bool ->
?status:[ `Valid | `Deprecated of deprecated ] ->
(Conf_t.t -> 'a Conf_t.elt -> Conf_t.t) ->
(Conf_t.t -> 'a Conf_t.elt) ->
'a tThe type of option declarators, that is functions returning a declaration
Source
val choice :
all:'a Value.t Ocamlformat_stdlib.list ->
?removed_values:Value_removed.t Ocamlformat_stdlib.list ->
'a declaratorSource
val any :
'a Cmdliner.Arg.conv ->
values:typ ->
docv:Ocamlformat_stdlib.string ->
'a declaratorSource
val removed_option :
names:Ocamlformat_stdlib.string Ocamlformat_stdlib.list ->
since:Version.t ->
msg:Ocamlformat_stdlib.string ->
Ocamlformat_stdlib.unit tDeclare an option as removed. Using such an option will result in an helpful error including msg and since.
Source
val update :
Store.t ->
config:Conf_t.t ->
from:Conf_t.updated_from ->
name:Ocamlformat_stdlib.string ->
value:Ocamlformat_stdlib.string ->
inline:Ocamlformat_stdlib.bool ->
(Conf_t.t, Conf_t.Error.t) Ocamlformat_stdlib.Result.t