File tree Expand file tree Collapse file tree 17 files changed +71
-71
lines changed Expand file tree Collapse file tree 17 files changed +71
-71
lines changed Original file line number Diff line number Diff line change 8
8
9
9
#### Fixed
10
10
11
+ - Fixed compatibility with Cmdliner 1.1.0 (#371 , @Leonidas-from-XIV )
12
+
11
13
#### Removed
12
14
13
15
#### Security
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ let named wrapper = Term.(app (const wrapper))
5
5
6
6
let non_deterministic =
7
7
let doc = " Run non-deterministic tests." in
8
- let env = Arg. env_var ~doc " MDX_RUN_NON_DETERMINISTIC" in
8
+ let env = Cmd.Env. info ~doc " MDX_RUN_NON_DETERMINISTIC" in
9
9
named
10
10
(fun x -> `Non_deterministic x)
11
11
Arg. (value & flag & info [ " non-deterministic" ; " n" ] ~env ~doc )
Original file line number Diff line number Diff line change @@ -33,10 +33,11 @@ let run (`Setup ()) (`Syntax syntax) (`File file) =
33
33
Printf. printf " %s" (Mdx.Util.Csexp. to_string (List deps));
34
34
0
35
35
36
- let cmd =
37
- let open Cmdliner in
38
- let doc =
39
- " List the dependencies of the input file. This command is meant to be used \
40
- by dune only. There are no stability guarantees."
41
- in
42
- (Term. (pure run $ Cli. setup $ Cli. syntax $ Cli. file), Term. info " deps" ~doc )
36
+ let term = Cmdliner.Term. (const run $ Cli. setup $ Cli. syntax $ Cli. file)
37
+
38
+ let doc =
39
+ " List the dependencies of the input file. This command is meant to be used \
40
+ by dune only. There are no stability guarantees."
41
+
42
+ let info = Cmdliner.Cmd. info " deps" ~doc
43
+ let cmd = Cmdliner.Cmd. v info term
Original file line number Diff line number Diff line change 14
14
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
15
*)
16
16
17
- open Cmdliner
18
-
19
- val cmd : int Term .t * Term .info
17
+ val cmd : int Cmdliner.Cmd .t
Original file line number Diff line number Diff line change @@ -56,11 +56,11 @@ let run (`Setup ()) (`Prelude prelude) (`Directories dirs) =
56
56
Buffer. output_buffer stdout buffer;
57
57
0
58
58
59
- let cmd =
60
- let open Cmdliner in
61
- let doc =
62
- " Generate the source for a specialized testing binary. This command is \
63
- meant to be used by dune only. There are no stability guarantees."
64
- in
65
- ( Term. (pure run $ Cli. setup $ Cli. prelude $ Cli. directories),
66
- Term. info " dune-gen " ~doc )
59
+ let term = Cmdliner.Term. (const run $ Cli. setup $ Cli. prelude $ Cli. directories)
60
+
61
+ let doc =
62
+ " Generate the source for a specialized testing binary. This command is meant \
63
+ to be used by dune only. There are no stability guarantees."
64
+
65
+ let info = Cmdliner.Cmd. info " dune-gen " ~doc
66
+ let cmd = Cmdliner.Cmd. v info term
Original file line number Diff line number Diff line change 14
14
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
15
*)
16
16
17
- open Cmdliner
18
-
19
- val cmd : int Term .t * Term .info
17
+ val cmd : int Cmdliner.Cmd .t
Original file line number Diff line number Diff line change @@ -19,11 +19,11 @@ open Cmdliner
19
19
let cmds = [ Test. cmd; Pp. cmd; Deps. cmd; Dune_gen. cmd ]
20
20
let main (`Setup () ) = `Help (`Pager , None )
21
21
22
- let main =
22
+ let info =
23
23
let doc = " Execute markdown files." in
24
- let exits = Term. default_exits in
25
24
let man = [] in
26
- ( Term. (ret (const main $ Cli. setup)),
27
- Term. info " ocaml-mdx" ~version: " %%VERSION%%" ~doc ~exits ~man )
25
+ Cmd. info " ocaml-mdx" ~version: " %%VERSION%%" ~doc ~man
28
26
29
- let () = Term. (exit_status @@ eval_choice main cmds)
27
+ let default = Term. (ret (const main $ Cli. setup))
28
+ let group = Cmd. group ~default info cmds
29
+ let () = Stdlib. exit @@ Cmd. eval' group
Original file line number Diff line number Diff line change @@ -62,8 +62,7 @@ let run (`Setup ()) (`File file) (`Section section) =
62
62
63
63
open Cmdliner
64
64
65
- let cmd =
66
- let doc = " Pre-process markdown files to produce OCaml code." in
67
- let exits = Term. default_exits in
68
- ( Term. (pure run $ Cli. setup $ Cli. file $ Cli. section),
69
- Term. info " pp" ~doc ~exits )
65
+ let term = Term. (const run $ Cli. setup $ Cli. file $ Cli. section)
66
+ let doc = " Pre-process markdown files to produce OCaml code."
67
+ let info = Cmd. info " pp" ~doc
68
+ let cmd = Cmd. v info term
Original file line number Diff line number Diff line change 14
14
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
15
*)
16
16
17
- open Cmdliner
18
-
19
- val cmd : int Term .t * Term .info
17
+ val cmd : int Cmdliner.Cmd .t
Original file line number Diff line number Diff line change @@ -47,11 +47,12 @@ let run (`Setup ()) _ _ _ _ _ _ _ _ _ _ =
47
47
48
48
open Cmdliner
49
49
50
- let cmd : int Term.t * Term.info =
51
- let doc = " Test markdown files." in
52
- ( Term. (
53
- pure run $ Cli. setup $ Cli. non_deterministic $ Cli. silent_eval
54
- $ Cli. syntax $ Cli. silent $ Cli. verbose_findlib $ Cli. prelude
55
- $ Cli. prelude_str $ Cli. file $ Cli. section $ Cli. root $ Cli. force_output
56
- $ Cli. output),
57
- Term. info " test" ~doc )
50
+ let term =
51
+ Term. (
52
+ const run $ Cli. setup $ Cli. non_deterministic $ Cli. silent_eval $ Cli. syntax
53
+ $ Cli. silent $ Cli. verbose_findlib $ Cli. prelude $ Cli. prelude_str
54
+ $ Cli. file $ Cli. section $ Cli. root $ Cli. force_output $ Cli. output)
55
+
56
+ let doc = " Test markdown files."
57
+ let info = Cmd. info " test" ~doc
58
+ let cmd = Cmd. v info term
You can’t perform that action at this time.
0 commit comments