Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow multiple paths to be given to -pa and -pz, closes #229

  • Loading branch information...
commit c3413246cf7c0cbb84470680333a3203a8f6c8c2 1 parent cd48652
José Valim josevalim authored
12 bin/elixir
View
@@ -2,12 +2,12 @@
if [ $# -eq 0 ]; then
echo "Usage: `basename $0` [options] [.exs file] [data]
- -v Prints version and exit
- -e \"command\" Evaluates the given command (*)
- -r \"file\" \"file\" Requires the given files/patterns (*)
- -pa \"path\" Prepend the given path to Erlang code path (*)
- -pz \"path\" Append the given path to Erlang code path (*)
- --no-halt Do not halt the Erlang VM after execution
+ -v Prints version and exit
+ -e \"command\" Evaluates the given command (*)
+ -r \"file1\" \"file2\" ... Requires the given files/patterns (*)
+ -pa \"dir1\" \"dir2\" ... Prepend the given paths to Erlang code path (*)
+ -pz \"dir1\" \"dir2\" ... Append the given paths to Erlang code path (*)
+ --no-halt Do not halt the Erlang VM after execution
** Options marked with (*) can be given more than once;
12 bin/elixir.bat
View
@@ -7,12 +7,12 @@ if "%*" == "" (
:documentation
echo Usage: %~nx0 [options] [.exs file] [data]
echo.
-echo -v Prints version and exit
-echo -e command Evaluates the given command (*)
-echo -r command Requires the given file/pattern (*)
-echo -pa path Prepend the given path to Erlang code path (*)
-echo -pz path Append the given path to Erlang code path (*)
-echo --no-halt Do not halt the Erlang VM after execution
+echo -v Prints version and exit
+echo -e command Evaluates the given command (*)
+echo -r command Requires the given file/pattern (*)
+echo -pa dir1 dir2 ... Prepend the given path to Erlang code path (*)
+echo -pz dir1 dir2 ... Append the given path to Erlang code path (*)
+echo --no-halt Do not halt the Erlang VM after execution
echo.
echo ** Options marked with (*) can be given more than once;
echo.
12 bin/elixirc
View
@@ -2,12 +2,12 @@
if [ $# -eq 0 ]; then
echo "Usage: `basename $0` [switches] [.ex files]
- -v Prints version and exit
- -o The directory to output compiled files
- -pa \"path\" Prepend the given path to Erlang code path (*)
- -pz \"path\" Append the given path to Erlang code path (*)
- --docs Attach documentation to compiled modules
- --debug-info Attach debug info to compiled modules
+ -v Prints version and exit
+ -o The directory to output compiled files
+ -pa \"dir1\" \"dir2\" ... Prepend the given paths to Erlang code path (*)
+ -pz \"dir1\" \"dir2\" ... Append the given paths to Erlang code path (*)
+ --docs Attach documentation to compiled modules
+ --debug-info Attach debug info to compiled modules
--ignore-module-conflict
** Options marked with (*) can be given more than once;
12 bin/elixirc.bat
View
@@ -7,12 +7,12 @@ if "%*" == "" (
:documentation
echo Usage: %~nx0 [switches] [.ex files]
echo.
-echo -v Prints version and exit
-echo -o The directory to output compiled files
-echo -pa path Prepend the given path to Erlang code path (*)
-echo -pz path Append the given path to Erlang code path (*)
-echo --docs Attach documentation to compiled modules
-echo --debug-info Attach debug info to compiled modules
+echo -v Prints version and exit
+echo -o The directory to output compiled files
+echo -pa dir1 dir2 ... Prepend the given path to Erlang code path (*)
+echo -pz dir1 dir2 ... Append the given path to Erlang code path (*)
+echo --docs Attach documentation to compiled modules
+echo --debug-info Attach debug info to compiled modules
echo --ignore-module-conflict
echo.
echo ** Options marked with (*) can be given more than once;
14 lib/elixir/cli.ex
View
@@ -88,14 +88,16 @@ defmodule Elixir.CLI do
process_shared t, config.prepend_commands [{:eval,h}]
end
- defp process_shared(['-pa',h|t], config) do
- Code.prepend_path(h)
- process_shared t, config
+ defp process_shared(['-pa'|t], config) do
+ { rest, paths } = process_list(t, [])
+ Enum.each paths, Code.prepend_path(&1)
+ process_shared rest, config
end
- defp process_shared(['-pz',h|t], config) do
- Code.append_path(h)
- process_shared t, config
+ defp process_shared(['-pz'|t], config) do
+ { rest, paths } = process_list(t, [])
+ Enum.each paths, Code.append_path(&1)
+ process_shared rest, config
end
defp process_shared(['-r'|t], config) do
Please sign in to comment.
Something went wrong with that request. Please try again.