Issue #17479 has been updated by mame (Yusuke Endoh).


+1 if we can provide `-B` option too.

----------------------------------------
Feature #17479: Enable to get "--backtrace-limit" value by "$-B"
https://bugs.ruby-lang.org/issues/17479#change-89561

* Author: neg_hide (Hidenori Negishi)
* Status: Open
* Priority: Normal
----------------------------------------
# Background

There is currently no way to get "--backtrace-limit" value when outputing backtraces from my script, so I have to ignore this value and output backtraces.

In order to be able to output according to "--backtrace-limit" value, I need a API to get this value from the Ruby side.

# Proposal

I propose a readonly built-in variable "$-B" to get "--backtrace-limit" value.

``` ruby
# ruby --backtrace-limit=3 script.rb

puts $-B # => 3
```



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>