summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-29 21:35:50 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-29 21:35:50 +0000
commita15c46b97917845d212a1132c732993605d6ba77 (patch)
tree7435d7580b806442ac004b4fd94f0d2ff9034cdc /lib
parent68be83f072bd5b7da9005b1009bef8f2ca326b1f (diff)
downloadruby-a15c46b97917845d212a1132c732993605d6ba77.tar.gz
ruby-a15c46b97917845d212a1132c732993605d6ba77.tar.xz
ruby-a15c46b97917845d212a1132c732993605d6ba77.zip
backout
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/optparse.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/optparse.rb b/lib/optparse.rb
index 0b1191513..e9a7138d7 100644
--- a/lib/optparse.rb
+++ b/lib/optparse.rb
@@ -223,7 +223,7 @@ Individual switch class.
def parse(arg, *val)
if block
val = conv.call(*val) if conv
- return arg, block, *val
+ return arg, block, val
else
return arg, nil
end
@@ -1122,8 +1122,8 @@ Default options, which never appear in option summary.
raise $!.set_option(arg, true)
end
begin
- opt, sw, *val = sw.parse(rest, argv) {|*exc| raise(*exc)}
- sw.call(*val) if sw
+ opt, sw, val = sw.parse(rest, argv) {|*exc| raise(*exc)}
+ sw.call(val) if sw
rescue ParseError
raise $!.set_option(arg, rest)
end
@@ -1149,10 +1149,10 @@ Default options, which never appear in option summary.
raise $!.set_option(arg, true)
end
begin
- opt, sw, *val = sw.parse(val, argv) {|*exc| raise(*exc) if eq}
+ opt, sw, 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-*/, '-')) != '-'
- sw.call(*val) if sw
+ sw.call(val) if sw
rescue ParseError
raise $!.set_option(arg, has_arg)
end