Skip to content

Commit e3b3015

Browse files
jonludlamJulow
andcommitted
Update src/driver/bin/odoc_driver_voodoo.ml
Co-authored-by: Jules Aguillon <jules@j3s.fr>
1 parent 6f93366 commit e3b3015

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

src/driver/bin/odoc_driver_voodoo.ml

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -97,24 +97,17 @@ let blessed =
9797
let doc = "Blessed" in
9898
Arg.(value & flag & info [ "blessed" ] ~doc)
9999

100-
let action_of_string = function
101-
| "compile-only" -> Ok CompileOnly
102-
| "link-and-gen" -> Ok LinkAndGen
103-
| "all" -> Ok All
104-
| _ ->
105-
Error
106-
(`Msg
107-
"Invalid action. Options are 'compile-only', 'link-and-gen' or 'all'")
108-
109-
let string_of_action fmt = function
110-
| CompileOnly -> Format.fprintf fmt "compile-only"
111-
| LinkAndGen -> Format.fprintf fmt "link-and-gen"
112-
| All -> Format.fprintf fmt "all"
113-
114-
let action_conv = Arg.conv (action_of_string, string_of_action)
100+
let action_conv =
101+
Arg.enum
102+
[
103+
("compile-only", CompileOnly); ("link-and-gen", LinkAndGen); ("all", All);
104+
]
115105

116106
let actions =
117-
let doc = "Actions to perform" in
107+
let doc =
108+
"Actions to perform. Valid values are 'compile-only', 'link-and-gen' and \
109+
'all'."
110+
in
118111
Arg.(value & opt action_conv All & info [ "actions" ] ~doc)
119112

120113
let odoc_dir =

0 commit comments

Comments
 (0)