From aea5a17fc4de4cceb9189a558c172321989d1a4e Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 12 Dec 2006 14:34:26 +0000 Subject: [PATCH] * 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 --- ChangeLog | 4 ++++ lib/optparse.rb | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index f10efa34a6..6f4c652cba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Dec 12 23:33:53 2006 Nobuyoshi Nakada + + * lib/optparse.rb (Switch#parse_arg, Switch#conv_arg): splat failures. + Mon Dec 11 11:51:10 2006 Akinori MUSHA * ext/digest/sha2/lib/sha2.rb: Moved one level up from under diff --git a/lib/optparse.rb b/lib/optparse.rb index 4cab6928bb..91520479ef 100644 --- a/lib/optparse.rb +++ b/lib/optparse.rb @@ -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