Project

General

Profile

Bug #13722 ยป ruby-op-octal-bug.rb

Reproduces the bug - wmccumstie (William McCumstie), 07/06/2017 09:58 AM

 
#!/usr/local/bin/ruby
require 'optionparser'

input = ["--decimal", "035"]
results = {}
op = OptionParser.new

op.on("--decimal NUMBER", OptionParser::DecimalInteger,
"DecimalInteger bug will convert as octal") do |v|
results[:decimal] = v
end

op.parse(input)

puts "Input: #{input[1]}"
puts "Parsed: #{results[:decimal]}"
    (1-1/1)