diff options
author | alisdair sullivan <alisdairsullivan@yahoo.ca> | 2015-07-01 13:28:57 -0700 |
---|---|---|
committer | alisdair sullivan <alisdairsullivan@yahoo.ca> | 2015-07-01 13:28:57 -0700 |
commit | 77a85b4a6899a22a132a9965fd0f4815655da890 (patch) | |
tree | bbcc3a2c569eff620f7d34f9924cd0390166931a /src | |
parent | bf1650e10db9249cab01bb8f6d726d0458555aa5 (diff) |
remove `cover_print_enabled` and `cover_data_dir` config options
and replace with `cover_opts`
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_prv_cover.erl | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/rebar_prv_cover.erl b/src/rebar_prv_cover.erl index b38c6b0..900c569 100644 --- a/src/rebar_prv_cover.erl +++ b/src/rebar_prv_cover.erl @@ -337,16 +337,24 @@ write_coverdata(State, Task) -> ?WARN("Cover data export failed: ~p", [Reason]) end. -verbose(State) -> +command_line_opts(State) -> {Opts, _} = rebar_state:command_parsed_args(State), - case proplists:get_value(verbose, Opts, missing) of - missing -> rebar_state:get(State, cover_print_enabled, false); - Else -> Else + Opts. + +config_opts(State) -> + rebar_state:get(State, cover_opts, []). + +verbose(State) -> + Command = proplists:get_value(verbose, command_line_opts(State), undefined), + Config = proplists:get_value(verbose, config_opts(State), undefined), + case {Command, Config} of + {undefined, undefined} -> false; + {undefined, Verbose} -> Verbose; + {Verbose, _} -> Verbose end. cover_dir(State) -> - rebar_state:get(State, cover_data_dir, filename:join([rebar_dir:base_dir(State), - "cover"])). + filename:join([rebar_dir:base_dir(State), "cover"]). cover_opts(_State) -> [{reset, $r, "reset", boolean, help(reset)}, |