Something went wrong. Try again.
OCaml linter enforcing modern coding conventions
Something went wrong. Try again.
12345678910111213141516171819202122(* Writes the module that carries the reader's source: each file named on the command line, by its base name, in the order given. [mli] writes its interface instead. *)
let () = match Array.to_list Sys.argv with | [ _; "mli" ] -> print_string "(** The reader's source files, carried in merlint's binary. *)\n\n\ val files : (string * string) list\n\ (** [files] is each file of the reader's source, as its base name and \ its contents. *)\n" | _ :: files -> print_string "let files =\n [\n"; List.iter (fun file -> let contents = In_channel.with_open_bin file In_channel.input_all in Fmt.pr " (%S,\n %S);\n" (Filename.basename file) contents) files; print_string " ]\n" | [] -> exit 2