mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/optparse.rb (Switch#parse_arg, Switch#conv_arg): splat failures.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2b38044b26
commit
aea5a17fc4
2 changed files with 7 additions and 3 deletions
|
@ -1,3 +1,7 @@
|
|||
Tue Dec 12 23:33:53 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/optparse.rb (Switch#parse_arg, Switch#conv_arg): splat failures.
|
||||
|
||||
Mon Dec 11 11:51:10 2006 Akinori MUSHA <knu@iDaemons.org>
|
||||
|
||||
* ext/digest/sha2/lib/sha2.rb: Moved one level up from under
|
||||
|
|
|
@ -321,10 +321,10 @@ class OptionParser
|
|||
# argument pattern. Yields when the pattern doesn't match substring.
|
||||
#
|
||||
def parse_arg(arg)
|
||||
pattern or return nil, arg
|
||||
pattern or return nil, [arg]
|
||||
unless m = pattern.match(arg)
|
||||
yield(InvalidArgument, arg)
|
||||
return arg, nil
|
||||
return arg, []
|
||||
end
|
||||
if String === m
|
||||
m = [s = m]
|
||||
|
@ -345,7 +345,7 @@ class OptionParser
|
|||
# conversion. Yields at semi-error condition instead of raising an
|
||||
# exception.
|
||||
#
|
||||
def conv_arg(arg, val = nil)
|
||||
def conv_arg(arg, val = [])
|
||||
if conv
|
||||
val = conv.call(*val)
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue