diff options
Diffstat (limited to 'lib/slop/types.rb')
-rw-r--r-- | lib/slop/types.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/slop/types.rb b/lib/slop/types.rb index b7e41c8..4cd6136 100644 --- a/lib/slop/types.rb +++ b/lib/slop/types.rb @@ -44,7 +44,7 @@ module Slop # Cast the option argument to an Integer. class IntegerOption < Option def call(value) - value =~ /\A-?\d+\z/ && value.to_i + value =~ /\A[+-]?\d+\z/ && value.to_i end end IntOption = IntegerOption |