ocaml-solo5-elftool/bin/main.ml

20 lines
479 B
OCaml
Raw Normal View History

2021-12-07 21:51:25 +00:00
let hex_dump file =
Owee_buf.map_binary file
|> Solo5_elftool.foo
|> Result.iter (fun s ->
Cstruct.of_string s |> Cstruct.hexdump)
let file =
let doc = "Solo5 executable" in
Cmdliner.Arg.(required & pos 0 (some file) None &
info ~doc ~docv:"EXECUTABLE" [])
let hex_dump_cmd =
let doc = "hexdump solo5 manifest" in
Cmdliner.Term.(
pure hex_dump $ file,
info ~doc "query-manifest")
let () =
ignore (Cmdliner.Term.eval hex_dump_cmd)