diff options
| author | Chimrod <> | 2023-11-04 11:54:08 +0100 | 
|---|---|---|
| committer | Chimrod <> | 2023-11-04 11:54:08 +0100 | 
| commit | 673da2554d3e667e0a62d5c7bbf30999f1295dc1 (patch) | |
| tree | 6fe7b79a4d70d31c6c405f6a943196a1b857dfdd /bin/args.ml | |
| parent | 0f24d6d6c6a61c9a3f090649003df7daabff4d65 (diff) | |
List all the available tests on command line
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  | 
