From 0dc399dc11912d9430564ebf9695ea0b2073f34c Mon Sep 17 00:00:00 2001 From: Juan Jose Comellas Date: Fri, 19 Jul 2013 02:24:52 -0300 Subject: [PATCH] Modify calls to format_error/2 to use the correct order for arguments --- examples/rebar_test.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/rebar_test.erl b/examples/rebar_test.erl index 6011ce8..51e9afe 100644 --- a/examples/rebar_test.erl +++ b/examples/rebar_test.erl @@ -17,9 +17,9 @@ test_required() -> test2(fun getopt:parse_and_check/2, "-f"). test_check() -> - test2(fun(O, L) -> - case getopt:parse(O, L) of - {ok, {Opts, _}} -> getopt:check(Opts, O); + test2(fun(OptSpecList, CmdLine) -> + case getopt:parse(OptSpecList, CmdLine) of + {ok, {Opts, _}} -> getopt:check(OptSpecList, Opts); Other -> Other end end, "-f"). @@ -40,7 +40,7 @@ test2(Fun, CmdLine) -> {ok, {Options, NonOptArgs}} -> io:format("Options:~n ~p~n~nNon-option arguments:~n ~p~n", [Options, NonOptArgs]); {error, {_Reason, _Data}} = Error -> - io:format("Error: ~s~n~n", [getopt:format_error(Error, OptSpecList)]), + io:format("Error: ~s~n~n", [getopt:format_error(OptSpecList, Error)]), usage(OptSpecList) end.