--- src/report/main.ml.orig 2023-07-17 20:20:34 +++ src/report/main.ml 2026-05-02 23:29:18 @@ -21,29 +21,15 @@ | exception Not_found -> [] | directory -> [Filename.concat directory "default"] -(* Many of the values used from Cmdliner.Term are deprecated in favor of values - from Cmdliner.Cmd. However, Cmdliner.Cmd was introduced in Cmdliner 1.1.0, - which requires OCaml 4.08.0. Bisect_ppx still supports OCaml 4.04, so Bisect - cannot use this recent version of Cmdliner. The 4.04 constraint itself is - only due to ppxlib. - - So, suppress the deprecation warnings. *) -module Term = -struct - include Cmdliner.Term - - let eval_choice = Cmdliner.Term.eval_choice [@ocaml.warning "-3"] - let exit = Cmdliner.Term.exit [@ocaml.warning "-3"] - let info = Cmdliner.Term.info [@ocaml.warning "-3"] -end - module Arg = Cmdliner.Arg +module Cmd = Cmdliner.Cmd +module Term = Cmdliner.Term (* Common arguments. *) -let term_info = Term.info ~sdocs:"COMMON OPTIONS" +let term_info = Cmd.info ~sdocs:"COMMON OPTIONS" let coverage_files from_position = Arg.(value @@ pos_right (from_position - 1) string [] @@ @@ -295,9 +281,8 @@ (* Entry point. *) let () = - Term.(eval_choice - (ret (const (`Help (`Auto, None))), - term_info + Cmd.group + (term_info "bisect-ppx-report" ~doc:"Generate coverage reports for OCaml and Reason." ~man:[ @@ -308,6 +293,10 @@ `P ("See bisect-ppx-report $(i,COMMAND) --help for further " ^ "information on each command, including options.") - ])) - [html; send_to; text; cobertura; coveralls; merge] - |> Term.exit + ] + ~exits:((Cmd.Exit.info ~doc:"on error." 1)::Cmd.Exit.defaults) + ) + ([html; send_to; text; cobertura; coveralls; merge] + |> List.map (fun (term, info) -> Cmd.v info term)) + |> Cmd.eval + |> exit