diff --git a/build_system/clerk_driver.ml b/build_system/clerk_driver.ml index c99e1635..0255a770 100644 --- a/build_system/clerk_driver.ml +++ b/build_system/clerk_driver.ml @@ -134,8 +134,8 @@ let info = "Please file bug reports at https://github.com/CatalaLang/catala/issues"; ] in - let exits = Term.default_exits @ [ Term.exit_info ~doc:"on error." 1 ] in - Term.info "clerk" ~version ~doc ~exits ~man + let exits = Cmd.Exit.defaults @ [ Cmd.Exit.info ~doc:"on error." 1 ] in + Cmd.info "clerk" ~version ~doc ~exits ~man (**{1 Testing}*) @@ -799,7 +799,4 @@ let driver Cli.error_print "The command \"%s\" is unknown to clerk." command; 1 -let main () = - match Cmdliner.Term.eval (clerk_t driver, info) with - | `Ok 0 -> Cmdliner.Term.exit (`Ok 0) - | _ -> Cmdliner.Term.exit (`Error `Term) +let main () = exit (Cmdliner.Cmd.eval' (Cmdliner.Cmd.v info (clerk_t driver))) diff --git a/catala.opam b/catala.opam index 7bbefb9e..1692f740 100644 --- a/catala.opam +++ b/catala.opam @@ -25,7 +25,7 @@ depends: [ "menhirLib" {>= "20200211"} "unionFind" {>= "20200320"} "bindlib" {>= "5.0.1"} - "cmdliner" {= "1.0.4"} + "cmdliner" {>= "1.1.0"} "re" {>= "1.9.0"} "zarith" {>= "1.12"} "zarith_stubs_js" {>= "v0.14.1"} diff --git a/clerk.opam b/clerk.opam index c32c878e..0b3976b3 100644 --- a/clerk.opam +++ b/clerk.opam @@ -12,7 +12,7 @@ bug-reports: "https://github.com/CatalaLang/catala/issues" depends: [ "dune" {>= "2.8"} "ocaml" {>= "4.11.0"} - "cmdliner" {= "1.0.4"} + "cmdliner" {>= "1.1.0"} "re" {>= "1.9.0"} "ANSITerminal" {>= "0.8.2"} "alcotest" {with-test & >= "1.5.0"} diff --git a/compiler/driver.ml b/compiler/driver.ml index 662faf30..9279de6a 100644 --- a/compiler/driver.ml +++ b/compiler/driver.ml @@ -412,8 +412,7 @@ let driver source_file (options : Cli.options) : int = let main () = let return_code = - Cmdliner.Term.eval (Cli.catala_t (fun f -> driver (FileName f)), Cli.info) + Cmdliner.Cmd.eval' + (Cmdliner.Cmd.v Cli.info (Cli.catala_t (fun f -> driver (FileName f)))) in - match return_code with - | `Ok 0 -> Cmdliner.Term.exit (`Ok 0) - | _ -> Cmdliner.Term.exit (`Error `Term) + exit return_code diff --git a/compiler/utils/cli.ml b/compiler/utils/cli.ml index 51d83795..18c9a928 100644 --- a/compiler/utils/cli.ml +++ b/compiler/utils/cli.ml @@ -315,8 +315,8 @@ let info = "Please file bug reports at https://github.com/CatalaLang/catala/issues"; ] in - let exits = Term.default_exits @ [ Term.exit_info ~doc:"on error." 1 ] in - Term.info "catala" ~version ~doc ~exits ~man + let exits = Cmd.Exit.defaults @ [ Cmd.Exit.info ~doc:"on error." 1 ] in + Cmd.info "catala" ~version ~doc ~exits ~man (**{1 Terminal formatting}*) diff --git a/compiler/utils/cli.mli b/compiler/utils/cli.mli index a4d50f09..bf9da148 100644 --- a/compiler/utils/cli.mli +++ b/compiler/utils/cli.mli @@ -101,7 +101,7 @@ val catala_t : (string -> options -> 'a) -> 'a Cmdliner.Term.t val set_option_globals : options -> unit val version : string -val info : Cmdliner.Term.info +val info : Cmdliner.Cmd.info (**{1 Terminal formatting}*)