Browse Source

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>
pull/1300/head
Rasmus Svensson 8 years ago
parent
commit
4c2873d213
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      src/rebar_prv_help.erl

+ 4
- 1
src/rebar_prv_help.erl View File

@ -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().

Loading…
Cancel
Save