Skip to content

Commit b3611f4

Browse files
boechat107sabine
authored andcommitted
Remove indentation from code comments
"ood-gen" uses a regex pattern that expects comments starting only at the beginning of lines.
1 parent 1c41928 commit b3611f4

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

data/cookbook/parse-command-line-arguments/00-stdlib.ml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,23 @@ let simplest_parser () =
99
|> Array.to_list
1010
|> List.iteri (Printf.printf "argument %d: %s\n")
1111

12-
1312
(* `Arg` is a module for parsing command-line arguments, and it is part of
1413
OCaml's standard library
1514
([documentation](https://ocaml.org/manual/5.3/api/Arg.html)).
1615
In this function we define the structure of the command-line arguments we
1716
expect, the argument types types and their documentation. This is basically
18-
the same function defined in the module's documentation.
19-
20-
*)
17+
the same function defined in the module's documentation. *)
2118
let arg_module_parser () =
2219
let usage_msg =
2320
"mycmd [--verbose] <file1> [<file2>] ... -o <output>"
2421
and verbose = ref false
2522
and input_files = ref []
2623
and output_file = ref "" in
27-
(* This function is called once for each anonymous argument. *)
24+
(* This function is called once for each anonymous argument. *)
2825
let anonymous_args_f filename =
2926
input_files := filename :: !input_files
30-
(* The spec list defines argument keywords, "setter" functions to handle the
31-
values, and their corresponding documentation. *)
27+
(* The spec list defines argument keywords, "setter" functions to handle the
28+
values, and their corresponding documentation. *)
3229
and spec_list =
3330
[("--verbose", Arg.Set verbose, "Output debug information");
3431
("-o", Arg.Set_string output_file, "Set output file name")]

data/cookbook/parse-command-line-arguments/01-cmdliner.ml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ packages:
1818
[this page](https://erratique.ch/software/cmdliner/doc/examples.html).
1919
*)
2020
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+
*)
2525
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. *)
2828
let verbose =
2929
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+
*)
3333
Arg.(value & flag & info ["v" ; "verbose"] ~doc)
3434
and input_files =
3535
let doc = "Input file(s)" in
@@ -40,17 +40,17 @@ let cmdliner_parser () =
4040
and docv = "OUTPUT" in
4141
Arg.(value & opt (some string) None
4242
& 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. *)
4545
and mycmd verbose input_files output_file =
4646
Printf.printf "verbose: %b\n" verbose;
4747
Printf.printf "input files: %s\n"
4848
(input_files |> String.concat ", ");
4949
Printf.printf "output file: %s\n"
5050
(Option.value ~default:"" output_file)
5151
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. *)
5454
let cmd =
5555
let doc = "An example command"
5656
and man = [

0 commit comments

Comments
 (0)