diff --git a/src/odoc/bin/main.ml b/src/odoc/bin/main.ml index 907d91047a..684b3422ae 100644 --- a/src/odoc/bin/main.ml +++ b/src/odoc/bin/main.ml @@ -499,15 +499,8 @@ module Indexing = struct let index dst json warnings_options includes_rec inputs_in_file inputs = let marshall = if json then `JSON else `Marshall in output_file ~dst marshall >>= fun output -> - match (includes_rec, inputs_in_file, inputs) with - | [], [], [] -> - Result.Error - (`Msg - "At least one of --file-list or --include-rec or an .odocl file \ - must be passed to odoc compile-index") - | _ -> - Indexing.compile marshall ~output ~warnings_options ~includes_rec - ~inputs_in_file ~odocls:inputs + Indexing.compile marshall ~output ~warnings_options ~includes_rec + ~inputs_in_file ~odocls:inputs let cmd = let dst = let doc = diff --git a/src/odoc/indexing.ml b/src/odoc/indexing.ml index 80d22e84c2..b7a3a16186 100644 --- a/src/odoc/indexing.ml +++ b/src/odoc/indexing.ml @@ -123,8 +123,6 @@ let compile out_format ~output ~warnings_options ~includes_rec ~inputs_in_file [] include_rec) |> List.concat) in - if files = [] then Error (`Msg "No .odocl files were included") - else - match out_format with - | `JSON -> compile_to_json ~output ~warnings_options files - | `Marshall -> compile_to_marshall ~output ~warnings_options files + match out_format with + | `JSON -> compile_to_json ~output ~warnings_options files + | `Marshall -> compile_to_marshall ~output ~warnings_options files diff --git a/test/search/html_search.t/run.t b/test/search/html_search.t/run.t index 4271bc810e..1354a36c2d 100644 --- a/test/search/html_search.t/run.t +++ b/test/search/html_search.t/run.t @@ -243,12 +243,18 @@ Testing the warnings/errors for the `compile-index` command: Passing an inexistent file: $ odoc compile-index --include-rec babar - ERROR: No .odocl files were included - [1] + $ odoc compile-index --file-list babar + odoc: option '--file-list': no 'babar' file or directory + Usage: odoc compile-index [--file-list=FILE] [--include-rec=DIR] [--json] [OPTION]… [FILE]… + Try 'odoc compile-index --help' or 'odoc --help' for more information. + [2] -Passing an empty folder: +Passing an empty folder is allowed: $ mkdir foo + $ odoc compile-index --include-rec foo + +Wrong file extensions: $ odoc compile-index -o index.odoc ERROR: When generating a binary index, the output must have a .odoc-index file extension @@ -259,9 +265,6 @@ Passing an empty folder: $ odoc compile-index --json -o index.odoc-index ERROR: When generating a json index, the output must have a .json file extension [1] - $ odoc compile-index --include-rec foo - ERROR: No .odocl files were included - [1] Passing a file which is not a correctly marshalled one: @@ -272,9 +275,6 @@ Passing a file which is not a correctly marshalled one: - -Passing no file: +Passing no file is allowed, generating an empty index: $ odoc compile-index - ERROR: At least one of --file-list or --include-rec or an .odocl file must be passed to odoc compile-index - [1]