diff options
author | ser <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-22 12:40:45 +0000 |
---|---|---|
committer | ser <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-22 12:40:45 +0000 |
commit | 8b53e39a2e6110cf13827c88673a3ef2667991cf (patch) | |
tree | eb1fa37c2a675b75c295285b5c313ba05801c2b8 /lib/optparse.rb | |
parent | f36a3f0ea57aa05a72cb58937c7a737455a98a38 (diff) | |
download | ruby-rexml_adds_tests.tar.gz |
Second merge from trunk.rexml_adds_tests
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/rexml_adds_tests@19455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/optparse.rb')
-rw-r--r-- | lib/optparse.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/optparse.rb b/lib/optparse.rb index 86681235a0..f457b072a9 100644 --- a/lib/optparse.rb +++ b/lib/optparse.rb @@ -632,7 +632,7 @@ class OptionParser list.each do |opt| if opt.respond_to?(:summarize) # perhaps OptionParser::Switch opt.summarize(*args, &block) - elsif !opt + elsif !opt or opt.empty? yield("") elsif opt.respond_to?(:each_line) opt.each_line(&block) @@ -1605,6 +1605,13 @@ class OptionParser argv end + def set_backtrace(array) + unless $DEBUG + array.delete_if(&%r"\A#{Regexp.quote(__FILE__)}:"o.method(:=~)) + end + super(array) + end + def set_option(opt, eq) if eq @args[0] = opt |