Load log into an string array
This commit is contained in:
parent
1fd977fede
commit
e1cc1d3858
3 changed files with 11 additions and 2 deletions
2
bin/dune
2
bin/dune
|
|
@ -1,2 +1,2 @@
|
|||
(executable
|
||||
(name main))
|
||||
(name inspector))
|
||||
|
|
|
|||
10
bin/inspector.ml
Normal file
10
bin/inspector.ml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
let load_lines filename =
|
||||
In_channel.with_open_text filename In_channel.input_lines |> Array.of_list
|
||||
|
||||
let () =
|
||||
if Array.length Sys.argv < 2 then (
|
||||
Printf.eprintf "Usage: %s <logfile>\n" (Filename.basename Sys.argv.(0));
|
||||
exit 1);
|
||||
|
||||
let contents = load_lines Sys.argv.(1) in
|
||||
Printf.printf "Loaded %d lines\n" (Array.length contents)
|
||||
|
|
@ -1 +0,0 @@
|
|||
print_endline "Hello"
|
||||
Loading…
Add table
Add a link
Reference in a new issue