summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-29 00:30:49 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-29 00:30:49 +0000
commit05c1ab35fce472a25b0db2fa1bc189ce12ca2302 (patch)
tree02533ae2d707876a85bde3b7c3a5056664bd34b5 /lib
parent402d2ca7a9841bba18fa4523d82179150c4f454f (diff)
* 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
Diffstat (limited to 'lib')
-rw-r--r--lib/optparse.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/optparse.rb b/lib/optparse.rb
index 84b2066f27..cf0791863b 100644
--- a/lib/optparse.rb
+++ b/lib/optparse.rb
@@ -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)