Skip to content

Commit

Permalink
Update src/driver/bin/odoc_driver_voodoo.ml
Browse files Browse the repository at this point in the history
Co-authored-by: Jules Aguillon <[email protected]>
  • Loading branch information
jonludlam and Julow committed Jan 13, 2025
1 parent 6f93366 commit e3b3015
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions src/driver/bin/odoc_driver_voodoo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,17 @@ let blessed =
let doc = "Blessed" in
Arg.(value & flag & info [ "blessed" ] ~doc)

let action_of_string = function
| "compile-only" -> Ok CompileOnly
| "link-and-gen" -> Ok LinkAndGen
| "all" -> Ok All
| _ ->
Error
(`Msg
"Invalid action. Options are 'compile-only', 'link-and-gen' or 'all'")

let string_of_action fmt = function
| CompileOnly -> Format.fprintf fmt "compile-only"
| LinkAndGen -> Format.fprintf fmt "link-and-gen"
| All -> Format.fprintf fmt "all"

let action_conv = Arg.conv (action_of_string, string_of_action)
let action_conv =
Arg.enum
[
("compile-only", CompileOnly); ("link-and-gen", LinkAndGen); ("all", All);
]

let actions =
let doc = "Actions to perform" in
let doc =
"Actions to perform. Valid values are 'compile-only', 'link-and-gen' and \
'all'."
in
Arg.(value & opt action_conv All & info [ "actions" ] ~doc)

let odoc_dir =
Expand Down

0 comments on commit e3b3015

Please sign in to comment.