Skip to content

Commit 1a91c64

Browse files
panglesdjonludlam
authored andcommitted
Driver: Add mli for Dune_style module
Signed-off-by: Paul-Elliot <[email protected]>
1 parent 9473fa1 commit 1a91c64

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

src/driver/dune_style.ml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22

33
let of_dune_build dir =
44
let contents =
5-
Bos.OS.Dir.fold_contents ~dotfiles:true
6-
(fun p acc -> p :: acc)
7-
[]
8-
Fpath.(v dir)
5+
Bos.OS.Dir.fold_contents ~dotfiles:true (fun p acc -> p :: acc) [] dir
96
in
107
match contents with
118
| Error _ -> Util.StringMap.empty
@@ -37,7 +34,7 @@ let of_dune_build dir =
3734
let cmtidir =
3835
Fpath.(path / Printf.sprintf ".%s.objs" libname / "byte")
3936
in
40-
match Fpath.rem_prefix (Fpath.v dir) path with
37+
match Fpath.rem_prefix dir path with
4138
| Some pkg_dir ->
4239
( pkg_dir,
4340
Packages.Lib.v pkg_dir

src/driver/dune_style.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
val of_dune_build : Fpath.t -> Packages.set

src/driver/odoc_driver.ml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -558,13 +558,8 @@ let run libs verbose packages_dir odoc_dir odocl_dir html_dir stats nb_workers
558558
ignore indexes
559559

560560
let fpath_arg =
561-
let parse s =
562-
match Fpath.of_string s with
563-
| Ok v -> Ok v
564-
| Error (`Msg m) -> Error (`Msg m)
565-
in
566561
let print ppf v = Fpath.pp ppf v in
567-
Arg.conv (parse, print)
562+
Arg.conv (Fpath.of_string, print)
568563

569564
let odoc_dir =
570565
let doc = "Directory in which the intermediate odoc files go" in
@@ -617,7 +612,7 @@ let blessed =
617612

618613
let dune_style =
619614
let doc = "Dune style" in
620-
Arg.(value & opt (some string) None & info [ "dune-style" ] ~doc)
615+
Arg.(value & opt (some fpath_arg) None & info [ "dune-style" ] ~doc)
621616

622617
let cmd =
623618
let doc = "Generate odoc documentation" in

0 commit comments

Comments
 (0)