Project

General

Profile

Actions

Feature #17479

closed

Enable to get "--backtrace-limit" value by "$-B"

Added by neg_hide (Hidenori Negishi) over 3 years ago. Updated about 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:101734]

Description

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 --backtrace-limit=3 script.rb

puts $-B # => 3
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0