summaryrefslogtreecommitdiff
path: root/src/rebar.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar.erl')
-rw-r--r--src/rebar.erl16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/rebar.erl b/src/rebar.erl
index 0c131ef..7ce409c 100644
--- a/src/rebar.erl
+++ b/src/rebar.erl
@@ -156,9 +156,7 @@ parse_args(Args) ->
proplists:get_bool(profile, Options)),
%% Set global variables based on getopt options
- LogLevel = proplists:get_value(verbose, Options,
- rebar_log:default_level()),
- rebar_config:set_global(verbose, LogLevel),
+ set_log_level(Options),
set_global_flag(Options, force),
DefJobs = rebar_config:get_jobs(),
case proplists:get_value(jobs, Options, DefJobs) of
@@ -185,6 +183,18 @@ parse_args(Args) ->
end.
%%
+%% set log level based on getopt option
+%%
+set_log_level(Options) ->
+ LogLevel = case proplists:get_all_values(verbose, Options) of
+ [] ->
+ rebar_log:default_level();
+ Verbosities ->
+ lists:last(Verbosities)
+ end,
+ rebar_config:set_global(verbose, LogLevel).
+
+%%
%% show version information and halt
%%
version() ->