Skip to content

Commit 013dd4a

Browse files
committed
escript: Rename --prepend-path to --paths, support globs and multiple uses
1 parent 04257cf commit 013dd4a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/ex_doc/cli.ex

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ defmodule ExDoc.CLI do
2323
],
2424
switches: [
2525
language: :string,
26+
paths: :keep,
2627
proglang: :string,
2728
source_ref: :string,
2829
version: :boolean
@@ -45,8 +46,9 @@ defmodule ExDoc.CLI do
4546

4647
Code.prepend_path(source_beam)
4748

48-
if opts[:prepend_path] do
49-
Code.prepend_path(opts[:prepend_path])
49+
for path <- Keyword.get_values(opts, :paths),
50+
path <- Path.wildcard(path) do
51+
Code.prepend_path(path)
5052
end
5153

5254
opts =
@@ -146,7 +148,9 @@ defmodule ExDoc.CLI do
146148
See "Custom config" section below for more information.
147149
-f, --formatter Docs formatter to use (html or epub), default: "html"
148150
-p, --homepage-url URL to link to for the site name
149-
--prepend-path Prepends the given path to Erlang code path
151+
--paths Prepends the given path to Erlang code path. The path might contain a glob
152+
pattern but in that case remember to quote it: --paths "_build/dev/lib/*/ebin".
153+
This option can be given multiple times
150154
--language Identify the primary language of the documents, its value must be
151155
a valid [BCP 47](https://tools.ietf.org/html/bcp47) language tag, default: "en"
152156
-l, --logo Path to the image logo of the project (only PNG or JPEG accepted)

0 commit comments

Comments
 (0)