diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-29 00:57:47 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-29 00:57:47 +0000 |
commit | 60a289741c3c67e4738d693b1ea90548a5fc4be2 (patch) | |
tree | b189e569827667159e0510c39ddf7cea201b96b5 /lib/optparse.rb | |
parent | d5195959bf2cb24f224eff386483f5df547d7bdc (diff) | |
download | ruby-60a289741c3c67e4738d693b1ea90548a5fc4be2.tar.gz |
* lib/optparse.rb (OptionParser::Switch#conv_arg): unsplat by
Proc#call if no conversion is given.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/optparse.rb')
-rw-r--r-- | lib/optparse.rb | 6 |
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) |