diff options
Diffstat (limited to 'src/rebar.erl')
-rw-r--r-- | src/rebar.erl | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/rebar.erl b/src/rebar.erl index 2d9fe04..1efa43f 100644 --- a/src/rebar.erl +++ b/src/rebar.erl @@ -258,13 +258,20 @@ save_options(Config, {Options, NonOptArgs}) -> %% set log level based on getopt option %% set_log_level(Config, Options) -> - LogLevel = case proplists:get_all_values(verbose, Options) of - [] -> - rebar_log:default_level(); - Verbosities -> - lists:last(Verbosities) - end, - rebar_config:set_global(Config, verbose, LogLevel). + Level = case proplists:get_bool(quiet, Options) of + true -> + rebar_log:error_level(); + false -> + DefaultLevel = rebar_log:default_level(), + case proplists:get_all_values(verbose, Options) of + [] -> + DefaultLevel; + Verbosities -> + DefaultLevel + lists:last(Verbosities) + end + end, + + rebar_config:set_global(Config, verbose, Level). %% %% show version information and halt @@ -375,12 +382,12 @@ option_spec_list() -> JobsHelp = io_lib:format( "Number of concurrent workers a command may use. Default: ~B", [Jobs]), - VerboseHelp = "Verbosity level (-v, -vv, -vvv, --verbose 3). Default: 0", [ %% {Name, ShortOpt, LongOpt, ArgSpec, HelpMsg} {help, $h, "help", undefined, "Show the program options"}, {commands, $c, "commands", undefined, "Show available commands"}, - {verbose, $v, "verbose", integer, VerboseHelp}, + {verbose, $v, "verbose", integer, "Verbosity level (-v, -vv)"}, + {quiet, $q, "quiet", boolean, "Quiet, only print error messages"}, {version, $V, "version", undefined, "Show version information"}, {force, $f, "force", undefined, "Force"}, {defines, $D, undefined, string, "Define compiler macro"}, |