Modify calls to format_error/2 to use the correct order for arguments
This commit is contained in:
parent
275d9362b7
commit
0dc399dc11
@ -17,9 +17,9 @@ test_required() ->
|
|||||||
test2(fun getopt:parse_and_check/2, "-f").
|
test2(fun getopt:parse_and_check/2, "-f").
|
||||||
|
|
||||||
test_check() ->
|
test_check() ->
|
||||||
test2(fun(O, L) ->
|
test2(fun(OptSpecList, CmdLine) ->
|
||||||
case getopt:parse(O, L) of
|
case getopt:parse(OptSpecList, CmdLine) of
|
||||||
{ok, {Opts, _}} -> getopt:check(Opts, O);
|
{ok, {Opts, _}} -> getopt:check(OptSpecList, Opts);
|
||||||
Other -> Other
|
Other -> Other
|
||||||
end
|
end
|
||||||
end, "-f").
|
end, "-f").
|
||||||
@ -40,7 +40,7 @@ test2(Fun, CmdLine) ->
|
|||||||
{ok, {Options, NonOptArgs}} ->
|
{ok, {Options, NonOptArgs}} ->
|
||||||
io:format("Options:~n ~p~n~nNon-option arguments:~n ~p~n", [Options, NonOptArgs]);
|
io:format("Options:~n ~p~n~nNon-option arguments:~n ~p~n", [Options, NonOptArgs]);
|
||||||
{error, {_Reason, _Data}} = Error ->
|
{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)
|
usage(OptSpecList)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user