diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-29 00:30:49 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-29 00:30:49 +0000 |
| commit | 33347c3f2220ff1f8b282d02cbdc76e798c623d9 (patch) | |
| tree | 02533ae2d707876a85bde3b7c3a5056664bd34b5 /lib/optparse.rb | |
| parent | 2e17c7fe1bc543b33a845b8d0d52ef61b0cbac90 (diff) | |
| download | ruby-33347c3f2220ff1f8b282d02cbdc76e798c623d9.tar.gz ruby-33347c3f2220ff1f8b282d02cbdc76e798c623d9.tar.xz ruby-33347c3f2220ff1f8b282d02cbdc76e798c623d9.zip | |
* lib/optparse.rb (parse_in_order): splat arguments to callback block.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@11047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/optparse.rb')
| -rw-r--r-- | lib/optparse.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/optparse.rb b/lib/optparse.rb index 84b2066f2..cf0791863 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) |
