summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/optparse.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/optparse.rb b/lib/optparse.rb
index cf0791863b..f790054ec2 100644
--- a/lib/optparse.rb
+++ b/lib/optparse.rb
@@ -349,7 +349,7 @@ class OptionParser
if conv
val = conv.call(*val)
else
- val = *val
+ val = proc {|val| val}.call(*val)
end
return arg, block, val
end
@@ -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)