Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 7e925ccc authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Refactoring: move to call to [Arg.parse] into [main].

parent abede482
No related branches found
No related tags found
No related merge requests found
......@@ -1506,21 +1506,18 @@ let run_random ?timeout prologue fuel : int =
(* -------------------------------------------------------------------------- *)
(* Find the name of our input file on the command line. *)
(* [main ?prologue fuel] parses the command line and starts testing. *)
let source : string option =
let main ?prologue:(prologue=ignore) fuel =
(* Parse the command line. *)
let usage = sprintf "Usage: %s <input file>" Sys.argv.(0) in
let source = ref None in
Arg.parse [] (fun s -> source := Some s) usage;
!source
(* -------------------------------------------------------------------------- *)
(* Reading input data from the source file whose name was given on the command
line, perform a number of test runs. *)
let main ?prologue:(prologue=ignore) fuel =
match source with
(* If a source file name was provided on the command line, enter AFL mode;
otherwise, enter random testing mode. *)
match !source with
| Some source ->
run_afl source prologue fuel
| None ->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment