summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-20 14:28:49 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-20 14:28:49 +0000
commit8446b6c59b3c9eb7c3b6c2163e1c7b26b9359e79 (patch)
tree9532db298cf1b1e3d569844cca16b317a5acb6c6 /lib
parent3be20019c163681f0de4dd8185ed46dace888520 (diff)
* ext/extmk.rb (parse_args): provisional catch-up for the recent changes.
* lib/optparse.rb (OptionParser::List#summarize, OptionParser#order!): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/optparse.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/optparse.rb b/lib/optparse.rb
index c79da48e01..6ecd7e3203 100644
--- a/lib/optparse.rb
+++ b/lib/optparse.rb
@@ -670,7 +670,7 @@ class OptionParser
list.each do |opt|
if opt.respond_to?(:summarize) # perhaps OptionParser::Switch
opt.summarize(*args, &block)
- elsif opt.empty?
+ elsif !opt or opt.empty?
yield("")
else
opt.each(&block)
@@ -1319,7 +1319,7 @@ class OptionParser
end
begin
opt, sw, val = sw.parse(rest, argv) {|*exc| raise(*exc)}
- sw.yield(*val) if sw
+ sw.yield(val) if sw
rescue ParseError
raise $!.set_option(arg, rest)
end