Skip to content

Commit df3fc07

Browse files
krfantasytmcgilchrist
authored andcommitted
fix cmdliner 2.0.0
1 parent bcedba7 commit df3fc07

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

dune-project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
(depends
1919
(ocaml (>= "5.0.0~"))
2020
hdr_histogram
21-
(cmdliner (and (>= 1.1.0) (< 2.0)))
21+
(cmdliner (>= 2.0.0))
2222
(trace-fuchsia (>= 0.10))
2323
(trace (>= 0.10))
2424
(menhir :with-test)

lib/olly_common/cli.ml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ let help man_format cmds topic =
2020
| None -> `Help (`Pager, None) (* help about the program. *)
2121
| Some topic -> (
2222
let topics = "topics" :: cmds in
23-
let conv, _ = Cmdliner.Arg.enum (List.rev_map (fun s -> (s, s)) topics) in
24-
match conv topic with
25-
| `Error e -> `Error (false, e)
26-
| `Ok t when t = "topics" ->
23+
let conv = Cmdliner.Arg.enum (List.rev_map (fun s -> (s, s)) topics) in
24+
let parse = Cmdliner.Arg.Conv.parser conv in
25+
match parse topic with
26+
| Error e -> `Error (false, e)
27+
| Ok t when t = "topics" ->
2728
List.iter print_endline topics;
2829
`Ok ()
29-
| `Ok t when List.mem t cmds -> `Help (man_format, Some t)
30-
| `Ok _t ->
30+
| Ok t when List.mem t cmds -> `Help (man_format, Some t)
31+
| Ok _t ->
3132
let page =
3233
((topic, 7, "", "", ""), [ `S topic; `P "Say something" ])
3334
in

runtime_events_tools.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ depends: [
1111
"dune" {>= "3.18"}
1212
"ocaml" {>= "5.0.0~"}
1313
"hdr_histogram"
14-
"cmdliner" {>= "1.1.0" & < "2.0"}
14+
"cmdliner" {>= "2.0.0"}
1515
"trace-fuchsia" {>= "0.10"}
1616
"trace" {>= "0.10"}
1717
"menhir" {with-test}

0 commit comments

Comments
 (0)