@@ -21,29 +21,15 @@ let esy_source_dir =
2121 | exception Not_found -> []
2222 | directory -> [Filename. concat directory " default" ]
2323
24- (* Many of the values used from Cmdliner.Term are deprecated in favor of values
25- from Cmdliner.Cmd. However, Cmdliner.Cmd was introduced in Cmdliner 1.1.0,
26- which requires OCaml 4.08.0. Bisect_ppx still supports OCaml 4.04, so Bisect
27- cannot use this recent version of Cmdliner. The 4.04 constraint itself is
28- only due to ppxlib.
29-
30- So, suppress the deprecation warnings. *)
31- module Term =
32- struct
33- include Cmdliner. Term
34-
35- let eval_choice = Cmdliner.Term. eval_choice [@ ocaml.warning " -3" ]
36- let exit = Cmdliner.Term. exit [@ ocaml.warning " -3" ]
37- let info = Cmdliner.Term. info [@ ocaml.warning " -3" ]
38- end
39-
4024module Arg = Cmdliner. Arg
25+ module Cmd = Cmdliner. Cmd
26+ module Term = Cmdliner. Term
4127
4228
4329
4430(* Common arguments. *)
4531
46- let term_info = Term . info ~sdocs: " COMMON OPTIONS"
32+ let term_info = Cmd . info ~sdocs: " COMMON OPTIONS"
4733
4834let coverage_files from_position =
4935 Arg. (value @@ pos_right (from_position - 1 ) string [] @@
@@ -303,9 +289,8 @@ let merge =
303289(* Entry point. *)
304290
305291let () =
306- Term. (eval_choice
307- (ret (const (`Help (`Auto , None ))),
308- term_info
292+ Cmd. group
293+ (term_info
309294 " bisect-ppx-report"
310295 ~doc: " Generate coverage reports for OCaml and Reason."
311296 ~man: [
@@ -316,6 +301,10 @@ let () =
316301 `P
317302 (" See bisect-ppx-report $(i,COMMAND) --help for further " ^
318303 " information on each command, including options." )
319- ]))
320- [html; send_to; text; cobertura; coveralls; merge]
321- |> Term. exit
304+ ]
305+ ~exits: ((Cmd.Exit. info ~doc: " on error." 1 )::Cmd.Exit. defaults)
306+ )
307+ ([html; send_to; text; cobertura; coveralls; merge]
308+ |> List. map (fun (term , info ) -> Cmd. v info term))
309+ |> Cmd. eval
310+ |> exit
0 commit comments