Skip to content

Commit 4df76e2

Browse files
authored
Merge pull request #80 from tmcgilchrist/cmdliner_2
Update cmdliner 2.0
2 parents 3ad0e8e + 96c8bea commit 4df76e2

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

.ocamlformat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = 0.27.0
1+
version = 0.28.1
22
profile = conventional
33

44
ocaml-version = 5.0.0

dune-project

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
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)
25-
(ocamlformat (and :with-dev-setup (= 0.27.0)))
25+
(ocamlformat (and :with-dev-setup (= 0.28.1)))
2626
(alcotest (and :with-test (>= 1.9.0)))))
2727

2828
(package
@@ -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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ 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}
18-
"ocamlformat" {with-dev-setup & = "0.27.0"}
18+
"ocamlformat" {with-dev-setup & = "0.28.1"}
1919
"alcotest" {with-test & >= "1.9.0"}
2020
"odoc" {with-doc}
2121
]

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)