Blob Blame History Raw
From ee1bdb724b4c6fc31d302a22daca9ca0a5e9d9eb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20B=C3=BCnzli?= <daniel.buenzli@erratique.ch>
Date: Thu, 3 Feb 2022 20:54:34 +0100
Subject: [PATCH] Handle cmdliner 1.1.0 deprecations.

---
 B0.ml           |  2 +-
 CHANGES.md      |  4 ++++
 opam            |  4 ++--
 test/utftrip.ml | 10 +++++-----
 4 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/B0.ml b/B0.ml
index b04a3bd..3334a12 100644
--- a/B0.ml
+++ b/B0.ml
@@ -47,7 +47,7 @@ let default =
       ["unicode"; "text"; "utf-8"; "utf-16"; "codec"; "org:erratique"]
     |> add B0_opam.Meta.depopts ["cmdliner", ""]
     |> add B0_opam.Meta.conflicts
-      [ "cmdliner", {|< "0.9.8"|}]
+      [ "cmdliner", {|< "1.1.0"|}]
     |> add B0_opam.Meta.depends
       [ "ocaml", {|>= "4.03.0"|};
         "ocamlfind", {|build|};
diff --git a/CHANGES.md b/CHANGES.md
index 50b1554..76778e5 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,3 +1,7 @@
+
+
+- Handle cmdliner 1.1.0 deprecations.
+
 v1.0.3 2022-02-03
 -----------------
 
diff --git a/opam b/opam
index 48dfb90..d06760c 100644
--- a/opam
+++ b/opam
@@ -14,7 +14,7 @@ depends: ["ocaml" {>= "4.03.0"}
           "ocamlbuild" {build}
           "topkg" {build & >= "1.0.3"}]
 depopts: ["cmdliner"]
-conflicts: ["cmdliner" {< "0.9.8"}]
+conflicts: ["cmdliner" {< "1.1.0"}]
 build: [["ocaml" "pkg/pkg.ml" "build" "--dev-pkg" "%{dev}%"
           "--with-cmdliner" "%{cmdliner:installed}%"]]
 description: """
@@ -26,7 +26,7 @@ character position tracking and support newline normalization.
 Functions are also provided to fold over the characters of UTF encoded
 OCaml string values and to directly encode characters in OCaml
 Buffer.t values. **Note** that since OCaml 4.14, that functionality
-can be found in the Stdlib and you are encouraged to migrate to.
+can be found in the Stdlib and you are encouraged to migrate to it.
 
 Uutf has no dependency and is distributed under the ISC license.
 
diff --git a/test/utftrip.ml b/test/utftrip.ml
index 28ba81b..361526e 100644
--- a/test/utftrip.ml
+++ b/test/utftrip.ml
@@ -382,12 +382,12 @@ let cmd =
         See http://erratique.ch/software/uutf for contact
         information."; ]
   in
-  Term.(pure do_cmd $ cmd $ file $ sin $ sout $ use_unix $ usize $
-        ienc $ oenc $ nln $ rseed $ rcount),
-  Term.info "utftrip" ~version:"%%VERSION%%" ~doc ~man
+  Cmd.v (Cmd.info "utftrip" ~version:"%%VERSION%%" ~doc ~man)
+    Term.(const do_cmd $ cmd $ file $ sin $ sout $ use_unix $ usize $
+          ienc $ oenc $ nln $ rseed $ rcount)
 
-let () = match Term.eval cmd with
-| `Error _ -> exit 1
+let () = match Cmd.eval_value cmd with
+| Error _ -> exit 1
 | _ -> if !input_malformed then exit 2 else exit 0
 
 (*---------------------------------------------------------------------------