From 4c2873d213ccdb4182f21c7179038897a66210b2 Mon Sep 17 00:00:00 2001 From: Rasmus Svensson Date: Mon, 15 Aug 2016 21:20:14 +0200 Subject: 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 [] --- src/rebar_prv_help.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/rebar_prv_help.erl') 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 [] "} end. -spec format_error(any()) -> iolist(). -- cgit v1.1