diff options
author | Rasmus Svensson <raek@raek.se> | 2016-08-15 21:20:14 +0200 |
---|---|---|
committer | Rasmus Svensson <raek@raek.se> | 2016-08-15 21:29:40 +0200 |
commit | 4c2873d213ccdb4182f21c7179038897a66210b2 (patch) | |
tree | 3796af862f75c0a655356c988fa7379a3ff28343 /src | |
parent | 3c5807fc033af8cc34200d44be7af8e22de8b9f2 (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>
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_prv_help.erl | 5 |
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(). |