Skip to content

Commit d0059c5

Browse files
committed
Apply fmt changes
1 parent ba0b360 commit d0059c5

File tree

2 files changed

+81
-81
lines changed

2 files changed

+81
-81
lines changed

src/cmdlang/command.mli

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
following is a minimalist command that does nothing:
1818
1919
{[
20-
let cmd : unit Command.t =
21-
Command.make
22-
~summary:"A command that does nothing."
23-
(let open Command.Std in
24-
let+ () = Arg.return () in
25-
())
26-
;;
20+
let cmd : unit Command.t =
21+
Command.make
22+
~summary:"A command that does nothing."
23+
(let open Command.Std in
24+
let+ () = Arg.return () in
25+
())
26+
;;
2727
]}
2828
2929
To get started with this API refers to this
@@ -107,13 +107,13 @@ module Nonempty_list : sig
107107
[string Nonempty_list.t] and may be used that way:
108108
109109
{[
110-
Arg.flag [ "verbose" ] ~doc:"Enable more output."
110+
Arg.flag [ "verbose" ] ~doc:"Enable more output."
111111
]}
112112
113113
The point being that the following would be a type error:
114114
115115
{[
116-
Arg.flag [] ~doc:"Enable more output."
116+
Arg.flag [] ~doc:"Enable more output."
117117
]} *)
118118
type 'a t = 'a Cmdlang_ast.Ast.Nonempty_list.t = ( :: ) : 'a * 'a list -> 'a t
119119
end
@@ -126,7 +126,7 @@ end
126126
build a parser for it with:
127127
128128
{[
129-
Param.enumerated (module My_enum)
129+
Param.enumerated (module My_enum)
130130
]} *)
131131

132132
module type Enumerated_stringable = sig
@@ -141,7 +141,7 @@ module type Enumerated_stringable = sig
141141
to be able to define an equality function between [t]s defined as such:
142142
143143
{[
144-
let equal a b = phys_equal a b || String.equal (to_string a) (to_string b)
144+
let equal a b = phys_equal a b || String.equal (to_string a) (to_string b)
145145
]} *)
146146
val to_string : t -> string
147147
end
@@ -234,22 +234,22 @@ module Param : sig
234234
235235
Example:
236236
{[
237-
module Color = struct
238-
type t =
239-
| Red
240-
| Green
241-
| Blue
242-
243-
let all = [ Red; Green; Blue ]
244-
245-
let to_string = function
246-
| Red -> "red"
247-
| Green -> "green"
248-
| Blue -> "blue"
249-
;;
250-
end
237+
module Color = struct
238+
type t =
239+
| Red
240+
| Green
241+
| Blue
242+
243+
let all = [ Red; Green; Blue ]
244+
245+
let to_string = function
246+
| Red -> "red"
247+
| Green -> "green"
248+
| Blue -> "blue"
249+
;;
250+
end
251251
252-
let color_param = Param.enumerated ~docv:"COLOR" (module Color)
252+
let color_param = Param.enumerated ~docv:"COLOR" (module Color)
253253
]}
254254
255255
The usage message will show the supported values for [COLOR]. *)
@@ -370,16 +370,16 @@ type 'a t
370370
371371
Example:
372372
{[
373-
let hello_cmd =
374-
Command.make
375-
~summary:"Prints [\"Hello, world!\"]."
376-
~readme:(fun () ->
377-
"This would usually be a longer description of the command.\n\
378-
It can be written on multiple lines.")
379-
(let open Command.Std in
380-
let+ () = Arg.return () in
381-
print_endline "Hello, world!")
382-
;;
373+
let hello_cmd =
374+
Command.make
375+
~summary:"Prints [\"Hello, world!\"]."
376+
~readme:(fun () ->
377+
"This would usually be a longer description of the command.\n\
378+
It can be written on multiple lines.")
379+
(let open Command.Std in
380+
let+ () = Arg.return () in
381+
print_endline "Hello, world!")
382+
;;
383383
]} *)
384384
val make : ?readme:(unit -> string) -> 'a Arg.t -> summary:string -> 'a t
385385

@@ -394,11 +394,11 @@ val make : ?readme:(unit -> string) -> 'a Arg.t -> summary:string -> 'a t
394394
395395
Example of a group with no default command:
396396
{[
397-
let cmd_group =
398-
Command.group
399-
~summary:"A group of related commands."
400-
[ "hello", hello_cmd; "goodbye", goodbye_cmd ]
401-
;;
397+
let cmd_group =
398+
Command.group
399+
~summary:"A group of related commands."
400+
[ "hello", hello_cmd; "goodbye", goodbye_cmd ]
401+
;;
402402
]}
403403
404404
Each command in the group may itself be a group, allowing for hierarchical
@@ -445,13 +445,13 @@ end
445445
For use with the [( let+ )] style:
446446
447447
{[
448-
let cmd : unit Command.t =
449-
Command.make
450-
~summary:"A command that does nothing."
451-
(let open Command.Std in
452-
let+ () = Arg.return () in
453-
())
454-
;;
448+
let cmd : unit Command.t =
449+
Command.make
450+
~summary:"A command that does nothing."
451+
(let open Command.Std in
452+
let+ () = Arg.return () in
453+
())
454+
;;
455455
]} *)
456456

457457
module Std : sig
@@ -466,12 +466,12 @@ end
466466
For use with the [( let%map_open.Command )] style:
467467
468468
{[
469-
let cmd : unit Command.t =
470-
Command.make
471-
~summary:"A command that does nothing."
472-
(let%map_open.Command () = Arg.return () in
473-
())
474-
;;
469+
let cmd : unit Command.t =
470+
Command.make
471+
~summary:"A command that does nothing."
472+
(let%map_open.Command () = Arg.return () in
473+
())
474+
;;
475475
]} *)
476476

477477
module Let_syntax : sig

test/cram/src/cmd.ml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -265,15 +265,15 @@ module Named = struct
265265
;;
266266
end
267267
in
268-
let open Command.Std in
269-
let+ e =
270-
Arg.named_with_default
271-
[ "who" ]
272-
(Param.create_with_pp ~docv:"(A|B)" ~parse:E.parse ~pp:E.pp ())
273-
~default:A
274-
~doc:"Greet A or B?"
275-
in
276-
print_endline ("Hello " ^ E.to_string e))
268+
let open Command.Std in
269+
let+ e =
270+
Arg.named_with_default
271+
[ "who" ]
272+
(Param.create_with_pp ~docv:"(A|B)" ~parse:E.parse ~pp:E.pp ())
273+
~default:A
274+
~doc:"Greet A or B?"
275+
in
276+
print_endline ("Hello " ^ E.to_string e))
277277
;;
278278

279279
let pos_int =
@@ -313,15 +313,15 @@ module Named = struct
313313
let of_string t = t
314314
end
315315
in
316-
let open Command.Std in
317-
let+ e =
318-
Arg.named_with_default
319-
[ "who" ]
320-
(Param.stringable (module Id))
321-
~default:(Id.of_string "my-id")
322-
~doc:"identifier"
323-
in
324-
print_endline ("Hello " ^ Id.to_string e))
316+
let open Command.Std in
317+
let+ e =
318+
Arg.named_with_default
319+
[ "who" ]
320+
(Param.stringable (module Id))
321+
~default:(Id.of_string "my-id")
322+
~doc:"identifier"
323+
in
324+
print_endline ("Hello " ^ Id.to_string e))
325325
;;
326326

327327
let validated =
@@ -359,15 +359,15 @@ module Named = struct
359359
;;
360360
end
361361
in
362-
let open Command.Std in
363-
let+ e =
364-
Arg.named_with_default
365-
[ "who" ]
366-
(Param.validated_string (module Id4))
367-
~default:Id4.default
368-
~doc:"4 letters alphanumerical identifier"
369-
in
370-
print_endline ("Hello " ^ Id4.to_string e))
362+
let open Command.Std in
363+
let+ e =
364+
Arg.named_with_default
365+
[ "who" ]
366+
(Param.validated_string (module Id4))
367+
~default:Id4.default
368+
~doc:"4 letters alphanumerical identifier"
369+
in
370+
print_endline ("Hello " ^ Id4.to_string e))
371371
;;
372372

373373
let comma_separated =

0 commit comments

Comments
 (0)