Skip to content

Commit a91fb71

Browse files
committed
Compatibility for cmdliner 2.0.0
The type Arg.conv was made abstract and now needs to be handled with specialized functions. I've tested that it still works with cmdliner 1.3.0. and verified that the function was introduced in 1.0.0. Unfortunately 1.1.0 is not available in opam anymore, so I did not test that. Signed-off-by: Pau Ruiz Safont <pau.safont@vates.tech>
1 parent c70799d commit a91fb71

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

bin/help.ml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,14 @@ let help man_format topic commands =
249249
| Some topic -> (
250250
let topics = ("topics" :: commands) @ List.map fst pages in
251251
let topics = List.sort compare topics in
252-
let conv, _ = Cmdliner.Arg.enum (List.rev_map (fun s -> (s, s)) topics) in
253-
match conv topic with
254-
| `Error e -> `Error (false, e)
255-
| `Ok t when List.mem t commands -> `Help (man_format, Some t)
256-
| `Ok t when t = "topics" ->
252+
let conv = Cmdliner.Arg.enum (List.rev_map (fun s -> (s, s)) topics) in
253+
match Arg.conv_parser conv topic with
254+
| Error (`Msg e) -> `Error (false, e)
255+
| Ok t when List.mem t commands -> `Help (man_format, Some t)
256+
| Ok t when t = "topics" ->
257257
Fmt.pr "@[<v>%a@]@." Fmt.(list string) topics;
258258
`Ok 0
259-
| `Ok t ->
259+
| Ok t ->
260260
let man = try List.assoc t pages with Not_found -> assert false in
261261
Fmt.pr "%a" (Cmdliner.Manpage.print man_format) man;
262262
`Ok 0)

dune-project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ with [Dune](https://github.com/ocaml/dune) and hosted on
3434
(fmt (>= 0.8.7))
3535
(fpath (>= 0.7.3))
3636
(bos (>= 0.1.3))
37-
(cmdliner (>= 1.1.0))
37+
(cmdliner (>= 1.3.0))
3838
(re (>= 1.7.2))
3939
astring
4040
(opam-file-format (>= 2.1.2))

dune-release.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ depends: [
2525
"fmt" {>= "0.8.7"}
2626
"fpath" {>= "0.7.3"}
2727
"bos" {>= "0.1.3"}
28-
"cmdliner" {>= "1.1.0"}
28+
"cmdliner" {>= "1.3.0"}
2929
"re" {>= "1.7.2"}
3030
"astring"
3131
"opam-file-format" {>= "2.1.2"}

0 commit comments

Comments
 (0)