From: "drbrain (Eric Hodel)" Date: 2013-09-05T13:29:49+09:00 Subject: [ruby-core:57034] [ruby-trunk - Bug #8865] OptionParser acceptable bugs Issue #8865 has been updated by drbrain (Eric Hodel). Assignee changed from nobu (Nobuyoshi Nakada) to drbrain (Eric Hodel) From #ruby-core IRC: 19:46 nokada: drbrain: seems fine, and add tests 1234xyz fails, plz ---------------------------------------- Bug #8865: OptionParser acceptable bugs https://bugs.ruby-lang.org/issues/8865#change-41631 Author: drbrain (Eric Hodel) Status: Assigned Priority: Normal Assignee: drbrain (Eric Hodel) 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/