summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Svensson <raek@raek.se>2016-08-15 21:20:14 +0200
committerRasmus Svensson <raek@raek.se>2016-08-15 21:29:40 +0200
commit4c2873d213ccdb4182f21c7179038897a66210b2 (patch)
tree3796af862f75c0a655356c988fa7379a3ff28343
parent3c5807fc033af8cc34200d44be7af8e22de8b9f2 (diff)
Print error on too many help arguments
Previously the help task would crash when given more than two arguments. After this change it instead print a message: Too many arguments given. Usage: rebar3 help [<namespace>] <task>
-rw-r--r--src/rebar_prv_help.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rebar_prv_help.erl b/src/rebar_prv_help.erl
index c028264..75cc609 100644
--- a/src/rebar_prv_help.erl
+++ b/src/rebar_prv_help.erl
@@ -41,7 +41,10 @@ do(State) ->
[Name] -> % default namespace
task_help(default, list_to_atom(Name), State);
[Namespace, Name] ->
- task_help(list_to_atom(Namespace), list_to_atom(Name), State)
+ task_help(list_to_atom(Namespace), list_to_atom(Name), State);
+ _ ->
+ {error, "Too many arguments given. " ++
+ "Usage: rebar3 help [<namespace>] <task>"}
end.
-spec format_error(any()) -> iolist().