* lib/optparse.rb (parse_in_order): splat arguments to callback block.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2006-09-29 00:30:49 +00:00
Родитель 402d2ca7a9
Коммит 05c1ab35fc
2 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -1,3 +1,7 @@
Fri Sep 29 09:29:45 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/optparse.rb (parse_in_order): splat arguments to callback block.
Thu Sep 28 23:59:31 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* node.h (struct thread): declare win32_exception_list on cygwin and

Просмотреть файл

@ -1259,7 +1259,7 @@ class OptionParser
end
begin
opt, cb, val = sw.parse(rest, argv) {|*exc| raise(*exc)}
val = cb.call(val) if cb
val = cb.call(*val) if cb
setter.call(sw.switch_name, val) if setter
rescue ParseError
raise $!.set_option(arg, rest)
@ -1290,7 +1290,7 @@ class OptionParser
opt, cb, val = sw.parse(val, argv) {|*exc| raise(*exc) if eq}
raise InvalidOption, arg if has_arg and !eq and arg == "-#{opt}"
argv.unshift(opt) if opt and (opt = opt.sub(/\A-*/, '-')) != '-'
val = cb.call(val) if cb
val = cb.call(*val) if cb
setter.call(sw.switch_name, val) if setter
rescue ParseError
raise $!.set_option(arg, arg.length > 2)