@@ -18,18 +18,18 @@ packages:
18
18
[this page](https://erratique.ch/software/cmdliner/doc/examples.html).
19
19
*)
20
20
let cmdliner_parser () =
21
- (* `Cmdliner` is a library that allows the declarative definition of
22
- command-line interfaces
23
- ([documentation page](https://erratique.ch/software/cmdliner/doc/index.html)).
24
- *)
21
+ (* `Cmdliner` is a library that allows the declarative definition of
22
+ command-line interfaces
23
+ ([documentation page](https://erratique.ch/software/cmdliner/doc/index.html)).
24
+ *)
25
25
let open Cmdliner in
26
- (* First we declare the expected arguments of our command-line, and how
27
- `Cmdliner` should parse them. *)
26
+ (* First we declare the expected arguments of our command-line, and how
27
+ `Cmdliner` should parse them. *)
28
28
let verbose =
29
29
let doc = " Output debug information" in
30
- (* `&` is a right associative composition operator
31
- ([documentation](https://erratique.ch/software/cmdliner/doc/Cmdliner/Arg/index.html#val-(&))).
32
- *)
30
+ (* `&` is a right associative composition operator
31
+ ([documentation](https://erratique.ch/software/cmdliner/doc/Cmdliner/Arg/index.html#val-(&))).
32
+ *)
33
33
Arg. (value & flag & info [" v" ; " verbose" ] ~doc )
34
34
and input_files =
35
35
let doc = " Input file(s)" in
@@ -40,17 +40,17 @@ let cmdliner_parser () =
40
40
and docv = " OUTPUT" in
41
41
Arg. (value & opt (some string ) None
42
42
& info [" o" ] ~docv ~doc )
43
- (* `mycmd` is the function that the program will apply to the parsed
44
- arguments. *)
43
+ (* `mycmd` is the function that the program will apply to the parsed
44
+ arguments. *)
45
45
and mycmd verbose input_files output_file =
46
46
Printf. printf " verbose: %b\n " verbose;
47
47
Printf. printf " input files: %s\n "
48
48
(input_files |> String. concat " , " );
49
49
Printf. printf " output file: %s\n "
50
50
(Option. value ~default: " " output_file)
51
51
in
52
- (* Declaration of the complete command, including its man-like
53
- documentation. *)
52
+ (* Declaration of the complete command, including its man-like
53
+ documentation. *)
54
54
let cmd =
55
55
let doc = " An example command"
56
56
and man = [
0 commit comments