diff options
author | Eric <[email protected]> | 2012-10-19 17:51:32 -0500 |
---|---|---|
committer | Jordan Wilberding <[email protected]> | 2012-10-24 11:30:00 -0600 |
commit | 4b675b9c9681e49ce4d5c0eef8c152e36e93b1f8 (patch) | |
tree | 2970281f300fb70675def7bbf23fe0e5235bfd44 /src/rcl_cmd_args.erl | |
parent | a7716890640a3d26b633219795008f3f2561d419 (diff) | |
download | relx-4b675b9c9681e49ce4d5c0eef8c152e36e93b1f8.tar.gz relx-4b675b9c9681e49ce4d5c0eef8c152e36e93b1f8.tar.bz2 relx-4b675b9c9681e49ce4d5c0eef8c152e36e93b1f8.zip |
add a bit of additional logging information
Signed-off-by: Jordan Wilberding <[email protected]>
Diffstat (limited to 'src/rcl_cmd_args.erl')
-rw-r--r-- | src/rcl_cmd_args.erl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rcl_cmd_args.erl b/src/rcl_cmd_args.erl index f12d216..ab073a2 100644 --- a/src/rcl_cmd_args.erl +++ b/src/rcl_cmd_args.erl @@ -32,8 +32,8 @@ -spec args2state({error, Reason::term()} | {[getopt:option()], [string()]}) -> {ok, {rcl_state:t(), [string()]}} | relcool:error(). -args2state(Error={error, _}) -> - Error; +args2state({error, Detail}) -> + ?RCL_ERROR({opt_parse, Detail}); args2state({ok, {Opts, Targets}}) -> RelName = proplists:get_value(relname, Opts, undefined), RelVsn = proplists:get_value(relvsn, Opts, undefined), @@ -52,6 +52,10 @@ args2state({ok, {Opts, Targets}}) -> end. -spec format_error(Reason::term()) -> iolist(). +format_error({opt_parse, {invalid_option, Opt}}) -> + io_lib:format("invalid option ~s~n", [Opt]); +format_error({opt_parse, Arg}) -> + io_lib:format("~p~n", [Arg]); format_error({invalid_option_arg, Arg}) -> case Arg of {goals, Goal} -> |