Source

erlint / src / erlint.ml

Full commit

type program_options = { file_path : string option }

let usage = ""

let parse_argv argv =
  let file_path = ref "" in

  let params = 
    Arg.align [ ("-f", Arg.Set_string file_path, "Path A file containing a list of paths to sequences (default stdin).")
	      ]
  in
  Arg.parse params (fun _ -> ()) usage;
  { file_path = if !file_path = "" then None else Some !file_path 
  }



let main argv =
  let program_options = parse_argv argv in
  let in_chan = 
    match program_options.file_path with
      | None -> stdin
      | Some path ->
	open_in path
  in
  let code_stream = Stream.of_channel in_chan in
  Token.pp (Lexer.lex code_stream)


let () = main Sys.argv