From: "drbrain (Eric Hodel)" Date: 2013-09-05T06:00:12+09:00 Subject: [ruby-core:57024] [ruby-trunk - Bug #8865][Assigned] OptionParser acceptable bugs Issue #8865 has been reported by drbrain (Eric Hodel). ---------------------------------------- Bug #8865: OptionParser acceptable bugs https://bugs.ruby-lang.org/issues/8865 Author: drbrain (Eric Hodel) Status: Assigned Priority: Normal Assignee: nobu (Nobuyoshi Nakada) Category: lib Target version: ruby -v: - Backport: 1.9.3: REQUIRED, 2.0.0: REQUIRED I have found a few bugs in OptionParser's accept feature: Hexadecimal and binary numbers are not properly supported for Integer OptionParser::DecimalInteger, OptionParser::OctalInteger and OptionParser::DecimalNumeric convert invalid input to 0 or nil instead of raising InvalidArgument. The attached patch fixes the validation regular expression for handling binary and hexadecimal arguments and adds verification for DecimalInteger, OctalInteger and DecimalNumeric -- http://bugs.ruby-lang.org/