summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/optparse.rb7
2 files changed, 12 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 7e0d62565a..0cfd894884 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Sep 18 20:37:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/optparse.rb (OptionParser::ParseError#set_backtrace): omits
+ OptionParser internal backtraces unless debug flag is set.
+
Thu Sep 18 20:02:48 2008 Yusuke Endoh <mame@tsg.ne.jp>
* lib/uri/common.rb (unescape): skip '%' to make String#hex work
diff --git a/lib/optparse.rb b/lib/optparse.rb
index 86681235a0..aef3c0d486 100644
--- a/lib/optparse.rb
+++ b/lib/optparse.rb
@@ -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