Skip to content

Commit 96290cd

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 96290cd

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
### Unreleased
2+
3+
### Added
4+
5+
- Add compatibility for cmdliner 2.0.0 (#<PR_NUMBER>, @psafont)
6+
17
## 2.1.0
28

39
### Added

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)

0 commit comments

Comments
 (0)