Skip to content

Commit 5cc97b9

Browse files
krfantasytmcgilchrist
authored andcommitted
Fix cmdliner 2.0
1 parent 3ad0e8e commit 5cc97b9

4 files changed

Lines changed: 11 additions & 10 deletions

File tree

dune-project

Lines changed: 2 additions & 2 deletions
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)
@@ -32,4 +32,4 @@
3232
(maintenance_intent "(latest)")
3333
(depends
3434
(ocaml (>= "5.0.0~"))
35-
(cmdliner (and (>= 1.1.0) (< 2.0)))))
35+
(cmdliner (>= 2.0.0))))

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}

runtime_events_tools_bare.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ bug-reports: "https://github.com/tarides/runtime_events_tools/issues"
1111
depends: [
1212
"dune" {>= "3.18"}
1313
"ocaml" {>= "5.0.0~"}
14-
"cmdliner" {>= "1.1.0" & < "2.0"}
14+
"cmdliner" {>= "2.0.0"}
1515
"odoc" {with-doc}
1616
]
1717
build: [

0 commit comments

Comments
 (0)