Project

General

Profile

Feature #8460 » 0003-Properly-keep-dash-dash.patch

Properly keep dash dash - felipec (Felipe Contreras), 04/02/2023 06:50 AM

View differences:

lib/optparse.rb
case arg
# dash dash
when /\A--\Z/m
nonopt.call(arg) if keep_unknown
break
# long option
test/optparse/test_optparse.rb
assert_raise(OptionParser::InvalidOption) {@opt.parse(%w(--mis))}
@opt.keep_unknown = true
assert_equal(%w(--mis arg), @opt.parse(%w(--mis -x arg)))
assert_equal(%w(--mis -- -x arg), @opt.parse(%w(--mis -- -x arg)))
end
end
(3-3/3)