ocaml-solo5-elftool/bin/main.ml

20 lines
514 B
OCaml
Raw Normal View History

2021-12-10 11:06:52 +00:00
let query_manifest file =
2021-12-07 21:51:25 +00:00
Owee_buf.map_binary file
2021-12-10 11:06:52 +00:00
|> Solo5_elftool.query_manifest
|> Result.iter (fun mft ->
Fmt.pr "%a\n" Solo5_elftool.pp_mft mft)
2021-12-07 21:51:25 +00:00
let file =
let doc = "Solo5 executable" in
Cmdliner.Arg.(required & pos 0 (some file) None &
info ~doc ~docv:"EXECUTABLE" [])
2021-12-10 11:06:52 +00:00
let query_manifest_cmd =
let doc = "query solo5 manifest" in
2021-12-07 21:51:25 +00:00
Cmdliner.Term.(
2021-12-10 11:06:52 +00:00
pure query_manifest $ file,
2021-12-07 21:51:25 +00:00
info ~doc "query-manifest")
let () =
2021-12-10 11:06:52 +00:00
ignore (Cmdliner.Term.eval query_manifest_cmd)