Feature #8460 » 0003-Properly-keep-dash-dash.patch
| 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
|
||
- « Previous
- 1
- 2
- 3
- Next »