summaryrefslogtreecommitdiff
path: root/test/printer.ml
blob: 5469d5ece1617f10dc6f43abb86b1cbfaaaf5e22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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