diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-21 05:46:01 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-21 05:46:01 +0000 |
commit | 8cd6a45a2a420dfb0926c659580b565e91a26865 (patch) | |
tree | c4769be127ab63b9b51f6136414314cc80a01efd /lib/optparse.rb | |
parent | 67cd02b40ceb2f1782e30f147dc14724267c2119 (diff) | |
download | ruby-8cd6a45a2a420dfb0926c659580b565e91a26865.tar.gz |
* lib/optparse.rb (parse_in_order): splat values to be passed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20900 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 134f1cf3b1..446039116a 100644 --- a/lib/optparse.rb +++ b/lib/optparse.rb @@ -1263,7 +1263,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) @@ -1294,7 +1294,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) |