summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Sloughter <tristan.sloughter@gmail.com>2015-04-04 21:13:24 -0500
committerTristan Sloughter <tristan.sloughter@gmail.com>2015-04-04 21:13:24 -0500
commita99344a47066dd26b02cf34e84c15aa2f6f4dbe5 (patch)
treedecea5eb0ec74ce37a2a62d012b36d139b483bad
parentd95da874cd9831f238e0c91c74b32ff4549dba59 (diff)
parent60f7474632000aa052ee4d5cea2eb7fbc094cc74 (diff)
Merge pull request #315 from ferd/fix-ns-help
Fix ns help
-rw-r--r--rebar.config2
-rw-r--r--src/rebar_prv_as.erl2
-rw-r--r--src/rebar_prv_clean.erl2
-rw-r--r--src/rebar_prv_common_test.erl4
-rw-r--r--src/rebar_prv_compile.erl2
-rw-r--r--src/rebar_prv_cover.erl2
-rw-r--r--src/rebar_prv_do.erl2
-rw-r--r--src/rebar_prv_edoc.erl2
-rw-r--r--src/rebar_prv_erlydtl_compiler.erl2
-rw-r--r--src/rebar_prv_eunit.erl2
-rw-r--r--src/rebar_prv_help.erl28
-rw-r--r--src/rebar_prv_release.erl2
-rw-r--r--src/rebar_prv_tar.erl2
-rw-r--r--src/rebar_prv_update.erl2
-rw-r--r--src/rebar_prv_version.erl2
15 files changed, 31 insertions, 27 deletions
diff --git a/rebar.config b/rebar.config
index 3997d8d..8d64b5d 100644
--- a/rebar.config
+++ b/rebar.config
@@ -24,7 +24,7 @@
{branch, "master"}}},
{providers, "",
{git, "https://github.com/tsloughter/providers.git",
- {tag, "v1.3.0"}}},
+ {tag, "v1.3.1"}}},
{erlydtl, ".*",
{git, "https://github.com/erlydtl/erlydtl.git",
{tag, "0.10.0"}}},
diff --git a/src/rebar_prv_as.erl b/src/rebar_prv_as.erl
index 6e3825f..64ad951 100644
--- a/src/rebar_prv_as.erl
+++ b/src/rebar_prv_as.erl
@@ -26,7 +26,7 @@ init(State) ->
{deps, ?DEPS},
{example, "rebar3 as <profile1>,<profile2>,... <task1>, <task2>, ..."},
{short_desc, "Higher order provider for running multiple tasks in a sequence as a certain profiles."},
- {desc, ""},
+ {desc, "Higher order provider for running multiple tasks in a sequence as a certain profiles."},
{opts, [{profile, undefined, undefined, string, "Profiles to run as."}]}])),
{ok, State1}.
diff --git a/src/rebar_prv_clean.erl b/src/rebar_prv_clean.erl
index 0da286b..a0793c1 100644
--- a/src/rebar_prv_clean.erl
+++ b/src/rebar_prv_clean.erl
@@ -26,7 +26,7 @@ init(State) ->
{deps, ?DEPS},
{example, "rebar3 clean"},
{short_desc, "Remove compiled beam files from apps."},
- {desc, ""},
+ {desc, "Remove compiled beam files from apps."},
{opts, [{all, $a, "all", undefined, "Clean all apps include deps"}]}])),
{ok, State1}.
diff --git a/src/rebar_prv_common_test.erl b/src/rebar_prv_common_test.erl
index 97f0637..de77257 100644
--- a/src/rebar_prv_common_test.erl
+++ b/src/rebar_prv_common_test.erl
@@ -28,7 +28,7 @@ init(State) ->
{bare, false},
{example, "rebar3 ct"},
{short_desc, "Run Common Tests."},
- {desc, ""},
+ {desc, "Run Common Tests."},
{opts, ct_opts(State)},
{profiles, [test]}]),
State1 = rebar_state:add_provider(State, Provider),
@@ -537,4 +537,4 @@ parse_term(String) ->
Terms;
Term ->
Term
- end. \ No newline at end of file
+ end.
diff --git a/src/rebar_prv_compile.erl b/src/rebar_prv_compile.erl
index 0b70f22..5053e57 100644
--- a/src/rebar_prv_compile.erl
+++ b/src/rebar_prv_compile.erl
@@ -25,7 +25,7 @@ init(State) ->
{deps, ?DEPS},
{example, "rebar3 compile"},
{short_desc, "Compile apps .app.src and .erl files."},
- {desc, ""},
+ {desc, "Compile apps .app.src and .erl files."},
{opts, []}])),
{ok, State1}.
diff --git a/src/rebar_prv_cover.erl b/src/rebar_prv_cover.erl
index 0ee6742..83fe012 100644
--- a/src/rebar_prv_cover.erl
+++ b/src/rebar_prv_cover.erl
@@ -29,7 +29,7 @@ init(State) ->
{deps, ?DEPS},
{example, "rebar3 cover"},
{short_desc, "Perform coverage analysis."},
- {desc, ""},
+ {desc, "Perform coverage analysis."},
{opts, cover_opts(State)},
{profiles, [test]}])),
{ok, State1}.
diff --git a/src/rebar_prv_do.erl b/src/rebar_prv_do.erl
index fd1767a..aee3a27 100644
--- a/src/rebar_prv_do.erl
+++ b/src/rebar_prv_do.erl
@@ -27,7 +27,7 @@ init(State) ->
{deps, ?DEPS},
{example, "rebar3 do <task1>, <task2>, ..."},
{short_desc, "Higher order provider for running multiple tasks in a sequence."},
- {desc, ""},
+ {desc, "Higher order provider for running multiple tasks in a sequence."},
{opts, []}])),
{ok, State1}.
diff --git a/src/rebar_prv_edoc.erl b/src/rebar_prv_edoc.erl
index eb57dcd..c9b89f0 100644
--- a/src/rebar_prv_edoc.erl
+++ b/src/rebar_prv_edoc.erl
@@ -23,7 +23,7 @@ init(State) ->
{deps, ?DEPS},
{example, "rebar3 edoc"},
{short_desc, "Generate documentation using edoc."},
- {desc, ""},
+ {desc, "Generate documentation using edoc."},
{opts, []}])),
{ok, State1}.
diff --git a/src/rebar_prv_erlydtl_compiler.erl b/src/rebar_prv_erlydtl_compiler.erl
index 79244ee..65f0094 100644
--- a/src/rebar_prv_erlydtl_compiler.erl
+++ b/src/rebar_prv_erlydtl_compiler.erl
@@ -119,7 +119,7 @@ init(State) ->
{deps, ?DEPS},
{example, "rebar3 erlydtl compile"},
{short_desc, "Compile erlydtl templates."},
- {desc, ""},
+ {desc, "Compile erlydtl templates."},
{opts, []}])),
{ok, State1}.
diff --git a/src/rebar_prv_eunit.erl b/src/rebar_prv_eunit.erl
index 6872c99..371d205 100644
--- a/src/rebar_prv_eunit.erl
+++ b/src/rebar_prv_eunit.erl
@@ -27,7 +27,7 @@ init(State) ->
{bare, false},
{example, "rebar3 eunit"},
{short_desc, "Run EUnit Tests."},
- {desc, ""},
+ {desc, "Run EUnit Tests."},
{opts, eunit_opts(State)},
{profiles, [test]}]),
State1 = rebar_state:add_provider(State, Provider),
diff --git a/src/rebar_prv_help.erl b/src/rebar_prv_help.erl
index b450023..be5717f 100644
--- a/src/rebar_prv_help.erl
+++ b/src/rebar_prv_help.erl
@@ -34,20 +34,14 @@ init(State) ->
-spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}.
do(State) ->
- {Args, _} = rebar_state:command_parsed_args(State),
- case proplists:get_value(help_task, Args, undefined) of
- undefined ->
+ case rebar_state:command_args(State) of
+ [] ->
help(State),
{ok, State};
- Name ->
- Providers = rebar_state:providers(State),
- case providers:get_provider(list_to_atom(Name), Providers) of
- not_found ->
- {error, io_lib:format("Unknown task ~s", [Name])};
- Provider ->
- providers:help(Provider),
- {ok, State}
- end
+ [Name] -> % default namespace
+ task_help(default, list_to_atom(Name), State);
+ [Namespace, Name] ->
+ task_help(list_to_atom(Namespace), list_to_atom(Name), State)
end.
-spec format_error(any()) -> iolist().
@@ -66,3 +60,13 @@ help(State) ->
providers:help(rebar_state:providers(State)),
?CONSOLE("~nRun 'rebar3 help <TASK>' for details.~n~n", []).
+
+task_help(Namespace, Name, State) ->
+ Providers = rebar_state:providers(State),
+ case providers:get_provider(Name, Providers, Namespace) of
+ not_found ->
+ {error, io_lib:format("Unknown task ~p", [Name])};
+ Provider ->
+ providers:help(Provider),
+ {ok, State}
+ end.
diff --git a/src/rebar_prv_release.erl b/src/rebar_prv_release.erl
index db012d5..c9a9c0b 100644
--- a/src/rebar_prv_release.erl
+++ b/src/rebar_prv_release.erl
@@ -26,7 +26,7 @@ init(State) ->
{deps, ?DEPS},
{example, "rebar3 release"},
{short_desc, "Build release of project."},
- {desc, ""},
+ {desc, "Build release of project."},
{opts, relx:opt_spec_list()}])),
{ok, State1}.
diff --git a/src/rebar_prv_tar.erl b/src/rebar_prv_tar.erl
index b5defbf..019036e 100644
--- a/src/rebar_prv_tar.erl
+++ b/src/rebar_prv_tar.erl
@@ -26,7 +26,7 @@ init(State) ->
{deps, ?DEPS},
{example, "rebar3 tar"},
{short_desc, "Tar archive of release built of project."},
- {desc, ""},
+ {desc, "Tar archive of release built of project."},
{opts, relx:opt_spec_list()}])),
{ok, State1}.
diff --git a/src/rebar_prv_update.erl b/src/rebar_prv_update.erl
index 170c591..be5cafd 100644
--- a/src/rebar_prv_update.erl
+++ b/src/rebar_prv_update.erl
@@ -27,7 +27,7 @@ init(State) ->
{deps, ?DEPS},
{example, "rebar3 update"},
{short_desc, "Update package index."},
- {desc, ""},
+ {desc, "Update package index."},
{opts, []}])),
{ok, State1}.
diff --git a/src/rebar_prv_version.erl b/src/rebar_prv_version.erl
index b2382db..5edcc85 100644
--- a/src/rebar_prv_version.erl
+++ b/src/rebar_prv_version.erl
@@ -26,7 +26,7 @@ init(State) ->
{deps, ?DEPS},
{example, "rebar3 version"},
{short_desc, "Print version for rebar and current Erlang."},
- {desc, ""},
+ {desc, "Print version for rebar and current Erlang."},
{opts, []}])),
{ok, State1}.