summaryrefslogtreecommitdiff
path: root/src/rebar_prv_deps.erl
diff options
context:
space:
mode:
authoromarkj <omarkj@gmail.com>2014-11-03 13:58:58 -0800
committeromarkj <omarkj@gmail.com>2014-11-03 13:58:58 -0800
commita1d030c9649526422f58e0fb5dae9d33564b395a (patch)
treefeb95f0fec3421ed876e1802584430e18e29f73f /src/rebar_prv_deps.erl
parent58f4019fa62a73e335967870f6605182d7386830 (diff)
parenta3ec3a3424dd47e9687d0d2960ef2d3cba6a8f5c (diff)
add help
Diffstat (limited to 'src/rebar_prv_deps.erl')
-rw-r--r--src/rebar_prv_deps.erl27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/rebar_prv_deps.erl b/src/rebar_prv_deps.erl
index 111f32f..80122ac 100644
--- a/src/rebar_prv_deps.erl
+++ b/src/rebar_prv_deps.erl
@@ -1,9 +1,10 @@
-module(rebar_prv_deps).
--behaviour(rebar_provider).
+-behaviour(provider).
-export([init/1,
- do/1]).
+ do/1,
+ format_error/2]).
-include("rebar.hrl").
@@ -12,20 +13,24 @@
-spec init(rebar_state:t()) -> {ok, rebar_state:t()}.
init(State) ->
- State1 = rebar_state:add_provider(State, #provider{name = ?PROVIDER,
- provider_impl = ?MODULE,
- bare = true,
- deps = ?DEPS,
- example = "rebar deps",
- short_desc = "List dependencies",
- desc = info("List dependencies"),
- opts = []}),
+ State1 = rebar_state:add_provider(State, providers:create([{name, ?PROVIDER},
+ {module, ?MODULE},
+ {bare, true},
+ {deps, ?DEPS},
+ {example, "rebar deps"},
+ {short_desc, "List dependencies"},
+ {desc, info("List dependencies")},
+ {opts, []}])),
{ok, State1}.
--spec do(rebar_state:t()) -> {ok, rebar_state:t()}.
+-spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}.
do(State) ->
{ok, State}.
+-spec format_error(any(), rebar_state:t()) -> {iolist(), rebar_state:t()}.
+format_error(Reason, State) ->
+ {io_lib:format("~p", [Reason]), State}.
+
info(Description) ->
io_lib:format("~s.~n"
"~n"