mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 11:06:20 +00:00
getopt optimization and dialyzer fix from Kostis
This commit is contained in:
parent
933e4f7620
commit
7200d18671
1 changed files with 3 additions and 3 deletions
|
@ -25,7 +25,7 @@
|
|||
-define(OPT_ARG, 4).
|
||||
-define(OPT_HELP, 5).
|
||||
|
||||
-define(IS_OPT_SPEC(Opt), (is_tuple(Opt) andalso (size(Opt) =:= ?OPT_HELP))).
|
||||
-define(IS_OPT_SPEC(Opt), (tuple_size(Opt) =:= ?OPT_HELP)).
|
||||
|
||||
|
||||
%% Atom indicating the data type that an argument can be converted to.
|
||||
|
@ -456,10 +456,10 @@ usage_options_reverse([{Name, Short, Long, _ArgSpec, Help} | Tail], Acc) ->
|
|||
case Short of
|
||||
% Only long form.
|
||||
undefined ->
|
||||
[$-, $-, Long];
|
||||
[$-, $- | Long];
|
||||
% Both short and long form.
|
||||
_ ->
|
||||
[$-, Short, $,, $\s, $-, $-, Long]
|
||||
[$-, Short, $,, $\s, $-, $- | Long]
|
||||
end
|
||||
end,
|
||||
usage_options_reverse(Tail, add_option_help(Prefix, Help, Acc));
|
||||
|
|
Loading…
Reference in a new issue