diff --git a/bin/elixir b/bin/elixir index 3c17c020198..4a37e3491da 100755 --- a/bin/elixir +++ b/bin/elixir @@ -18,7 +18,7 @@ Usage: $(basename "$0") [options] [.exs file] [data] -pz "PATH" Appends the given path to Erlang code path (*) -v, --version Prints Erlang/OTP and Elixir versions (standalone) - --color BOOL Enables or disables ANSI coloring + --color, --no-color Enables or disables ANSI coloring --erl "SWITCHES" Switches to be passed down to Erlang (*) --eval "COMMAND" Evaluates the given command, same as -e (*) --logger-otp-reports BOOL Enables or disables OTP reporting @@ -112,10 +112,10 @@ while [ $I -le $LENGTH ]; do C=1 MODE="iex" ;; - -v|--no-halt) + -v|--no-halt|--color|--no-color) C=1 ;; - -e|-r|-pr|-pa|-pz|--eval|--remsh|--dot-iex|--dbg|--color) + -e|-r|-pr|-pa|-pz|--eval|--remsh|--dot-iex|--dbg) C=2 ;; --rpc-eval) diff --git a/bin/elixir.bat b/bin/elixir.bat index d2272b20a29..d0657c44a70 100644 --- a/bin/elixir.bat +++ b/bin/elixir.bat @@ -24,7 +24,7 @@ echo -pa "PATH" Prepends the given path to Erlang code path echo -pz "PATH" Appends the given path to Erlang code path (*) echo -v, --version Prints Erlang/OTP and Elixir versions (standalone) echo. -echo --color BOOL Enables or disables ANSI coloring +echo --color, --no-color Enables or disables ANSI coloring echo --erl "SWITCHES" Switches to be passed down to Erlang (*) echo --eval "COMMAND" Evaluates the given command, same as -e (*) echo --logger-otp-reports BOOL Enables or disables OTP reporting @@ -108,10 +108,11 @@ if ""==!par:-pz=! (shift && goto startloop) if ""==!par:-v=! (goto startloop) if ""==!par:--version=! (goto startloop) if ""==!par:--no-halt=! (goto startloop) +if ""==!par:--color=! (goto startloop) +if ""==!par:--no-color=! (goto startloop) if ""==!par:--remsh=! (shift && goto startloop) if ""==!par:--dot-iex=! (shift && goto startloop) if ""==!par:--dbg=! (shift && goto startloop) -if ""==!par:--color=! (shift && goto startloop) rem ******* ERLANG PARAMETERS ********************** if ""==!par:--boot=! (set "parsErlang=!parsErlang! -boot "%~1"" && shift && goto startloop) if ""==!par:--boot-var=! (set "parsErlang=!parsErlang! -boot_var "%~1" "%~2"" && shift && shift && goto startloop) diff --git a/lib/elixir/lib/kernel/cli.ex b/lib/elixir/lib/kernel/cli.ex index be1b9d0c102..66d123db6ea 100644 --- a/lib/elixir/lib/kernel/cli.ex +++ b/lib/elixir/lib/kernel/cli.ex @@ -295,21 +295,13 @@ defmodule Kernel.CLI do parse_argv(t, %{config | commands: [{:parallel_require, h} | config.commands]}) end - defp parse_argv([~c"--color", value | t], config) do - config = - case value do - ~c"true" -> - Application.put_env(:elixir, :ansi_enabled, true) - config - - ~c"false" -> - Application.put_env(:elixir, :ansi_enabled, false) - config - - _ -> - %{config | errors: ["--color : must be a boolean" | config.errors]} - end + defp parse_argv([~c"--color" | t], config) do + Application.put_env(:elixir, :ansi_enabled, true) + parse_argv(t, config) + end + defp parse_argv([~c"--no-color" | t], config) do + Application.put_env(:elixir, :ansi_enabled, true) parse_argv(t, config) end diff --git a/lib/mix/lib/mix/tasks/test.ex b/lib/mix/lib/mix/tasks/test.ex index 167ca3ee111..b55040ec0c9 100644 --- a/lib/mix/lib/mix/tasks/test.ex +++ b/lib/mix/lib/mix/tasks/test.ex @@ -113,7 +113,7 @@ defmodule Mix.Tasks.Test do and imports (but not local functions). You can press `n` for the next line and `c` for the next test. This automatically sets `--trace` - * `--color` - enables color in the output + * `--color` - enables color in ExUnit formatting results * `--cover` - runs coverage tool. See "Coverage" section below