diff options
Diffstat (limited to 'bin/args.ml')
-rw-r--r-- | bin/args.ml | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/bin/args.ml b/bin/args.ml index 27c5a70..0021b34 100644 --- a/bin/args.ml +++ b/bin/args.ml @@ -23,7 +23,7 @@ let level : string -> unit = print_endline e; exit 1 -let speclist = +let speclist printer = let common_arguments = [ ( "--version", @@ -32,7 +32,15 @@ let speclist = Printf.printf "Version %s\n" Tools.Git_hash.revision; exit 0), "\tDisplay the version of the application and exit" ); - ("--level", Arg.String level, "\tMessage level [debug, warn, error]"); + ( "--list-tests", + Arg.Unit + (fun () -> + printer Format.std_formatter; + exit 0), + "\tPrint all the available tests then exit" ); + ( "--level", + Arg.String level, + "\tFilter with this message level [debug, warn, error]" ); ( "--global", Arg.Set reset_line, "\tEach line is refered from the begining of the file and not the \ @@ -46,8 +54,9 @@ let speclist = in common_arguments @ windows_arguments -let parse : unit -> string list * t = - fun () -> +let parse : list_tests:(Format.formatter -> unit) -> string list * t = + fun ~list_tests -> + let speclist = speclist list_tests in let () = Arg.parse (Arg.align speclist) anon_fun usage in match !input_files with |