diff options
| author | Sébastien Dailly <sebastien@dailly.me> | 2026-03-27 08:48:05 +0100 |
|---|---|---|
| committer | Sébastien Dailly <sebastien@dailly.me> | 2026-03-27 08:48:05 +0100 |
| commit | 830e7c5d27d161b91402414e6ecd49f1ed818bfb (patch) | |
| tree | 448864635d29b1ea66424cbb9e0816fbcf1e1907 /test/printer.ml | |
Initial commit
Diffstat (limited to 'test/printer.ml')
| -rw-r--r-- | test/printer.ml | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/printer.ml b/test/printer.ml new file mode 100644 index 0000000..5469d5e --- /dev/null +++ b/test/printer.ml @@ -0,0 +1,22 @@ +let name = __FILE__ +let description = "Print the configuration in json format" +let speclist = [] + +type t = (Configuration.Ast.setting, Configuration.Read_conf.error) result + +module TomlConf = Configuration.Read_conf.Make (Configuration.Toml.Decode) + +let read_conf : + string -> + (Configuration.Ast.setting, Configuration.Toml.Decode.error) result = + fun file -> Configuration.Toml.Decode.decode_file TomlConf.t file + +module ToJson = Configuration.Read_conf.Make (Configuration.Json5.Encode) + +let print_conf : + Configuration.Ast.setting -> Configuration.Json5.Json_encodeable.value = + fun _ -> raise Not_found + +let pp : Format.formatter -> t -> unit = + Format.pp_print_result ~error:Configuration.Read_conf.pp_error + ~ok:Format.pp_print_int |
