summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTuncer Ayaz <tuncer.ayaz@gmail.com>2010-10-01 15:55:17 +0200
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2010-10-01 15:55:17 +0200
commit7200d18671b16155ed658fb5390708bbc9acff2a (patch)
tree8a674b55c0efc0b23a622ea55253a3d5837d2d0b
parent933e4f7620a32fc933fafc0578d1802ddc048bc6 (diff)
getopt optimization and dialyzer fix from Kostis
-rw-r--r--src/getopt.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/getopt.erl b/src/getopt.erl
index 25ceab5..454a96e 100644
--- a/src/getopt.erl
+++ b/src/getopt.erl
@@ -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));