Skip to content

Commit 4dfe6f8

Browse files
committed
Bump cmdliner to 2.0.0
The type Arg.conv was made abstract and now needs to be handled with specialized functions. Shortened versions of the parameters do not work anymore. Signed-off-by: Pau Ruiz Safont <pau.safont@vates.tech>
1 parent 195d83c commit 4dfe6f8

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
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+
### Breaking
4+
5+
- Update to use cmdliner 2.0.0. Shortened arguments will not work anymore. (#512, @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)

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 (>= 2.0.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)